|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Automatic email with only updated range of cells to relevant receiver after save
Hello all, l’m new here and hope I can get some help. With a macro that I have not had any luck and 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.
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 |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Distribute text in one cell across a range of cells (overcoming selection.range.cells.count bug) | slaycock | Word VBA | 0 | 02-18-2017 07:00 AM |
Automatic, updated summary table in the end of document | tilde85 | Word | 4 | 02-14-2017 06:37 AM |
data entered in one workbook should be updated in other relevant workbook based on the date | vedha | Excel | 0 | 04-24-2015 08:45 PM |
Copying text range of cells to different cells adds an extra line | jpb103 | Word VBA | 2 | 07-23-2014 12:22 PM |
Count range cells eliminating merge cells | danbenedek | Excel | 0 | 06-15-2010 12:40 AM |