• Automatic email with only updated range of cells to relevant receiver

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Automatic email with only updated range of cells to relevant receiver

    Author
    Topic
    #1773149

    Hello all, l’m new here and hope I can get some help. With a macro that I have not had any luck and [/COLOR]have spent hours trying to get correct results. I have a workbook that tracks data issues / cases from employees and I need is an automatic email sent to relevant receiver when some of the cells are updated. Basically if someone will include new row with new values ( so increase the list in table ) and will save the workbook, it will automatically send an email to relevant receiver with body included new row which was created. Also in case that someone will create few new rows it will send the list of new rows included ( eg. the table with rows is in range A:P ) and also after save it will automatically put value Y ( as YES) to the new created rows in column P. So there will be a track about the status of data case, that these rows were already sent to relevant receiver. And another sub macro which should be included in the first one, that after change of column L, which will be the status of open/closed case it will automatically send and email to another relevant person ( requestor of the data case). I have been trying to get this put together for some time but I just can figure it out so I’m asking if any of you experts can help me with this.I will greatly appreciate for any help. Below you can see that I have created macro for automatic sending of email, but do not know how to include all othe figures which I would like to have. [/COLOR]

    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    ‘Updated by requestor 2018/4/13
    Dim xOutApp As Object
    Dim xMailItem As Object
    Dim xName As String
    On Error Resume Next
    Set xOutApp = CreateObject(“Outlook.Application”)
    Set xMailItem = xOutApp.CreateItem(0)
    xName = ActiveWorkbook.FullName
    With xMailItem
    .To = “email”
    .CC = “email”
    .Subject = “Issue Tracker – update”
    .Body = “Dear Team,” & Chr(13) & Chr(13) & “please be informed, that the tracker has been updated with data below.”
    .Send
    End With
    Set xMailItem = Nothing
    Set xOutApp = Nothing
    End Sub

    In case of any question I am free to answer them. ( hopefully 🙂 )

    Thank you.

    Peter

    Reply To: Automatic email with only updated range of cells to relevant receiver

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: