I need to run 3 separate worksheet changes in one worksheet. I am not sure what to do after the the first one.
My code is as follows for the 1st one. I would like to conditionally format when a value changes in Columns AC & CS
This is the first worksheet change
Private Sub Worksheet_Change(ByVal Target As Range)
Dim xOutApp As Object, xMailItem As Object, xMailBody As String
On Error Resume Next
Application.ScreenUpdating = False
Application.DisplayAlerts = False
If Intersect(Target, Range("AG:AG, CW:CW, DB:DB")) Is Nothing Then Exit Sub
ActiveWorkbook.Save
Set xOutApp = CreateObject("Outlook.Application")
Set xMailItem = xOutApp.CreateItem(0)
xMailBody = "Cell(s) " & Target.Address(False, False) & " (In the CPM Tracker press F5 to go to the cell referenced to see what TI Field needs to be updated) in the worksheet '" & Me.Name & "' were modified on " & _
Format$(Now, "mm/dd/yyyy") & " at " & Format$(Now, "hh:mm:ss") & " by " & Environ$("username") & "."
If Target = "A" Then
With xMailItem
.to = "sharonca@amdocs.com"
.Subject = "Worksheet modified - " & "Ticket " & Range("A" & Target.Row).Value & " - Update TI Date"
.Body = xMailBody
.Display
End With
End If
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
My code is as follows for the 1st one. I would like to conditionally format when a value changes in Columns AC & CS
This is the first worksheet change
Private Sub Worksheet_Change(ByVal Target As Range)
Dim xOutApp As Object, xMailItem As Object, xMailBody As String
On Error Resume Next
Application.ScreenUpdating = False
Application.DisplayAlerts = False
If Intersect(Target, Range("AG:AG, CW:CW, DB:DB")) Is Nothing Then Exit Sub
ActiveWorkbook.Save
Set xOutApp = CreateObject("Outlook.Application")
Set xMailItem = xOutApp.CreateItem(0)
xMailBody = "Cell(s) " & Target.Address(False, False) & " (In the CPM Tracker press F5 to go to the cell referenced to see what TI Field needs to be updated) in the worksheet '" & Me.Name & "' were modified on " & _
Format$(Now, "mm/dd/yyyy") & " at " & Format$(Now, "hh:mm:ss") & " by " & Environ$("username") & "."
If Target = "A" Then
With xMailItem
.to = "sharonca@amdocs.com"
.Subject = "Worksheet modified - " & "Ticket " & Range("A" & Target.Row).Value & " - Update TI Date"
.Body = xMailBody
.Display
End With
End If
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub