Hi all,
I'm new to VBA but am trying to automate a spreadsheet to automatically send out an email when a cell value equals "Complete". The flow I have in mind is that when a dropdown value is selected "Complete", then the data from another cell will be copied into an email body and automatically sent to several addresses. So far, I only have subroutines set up to generate the email minus the data from the cells I need. Also, the range I have selected is for all cells in column J, but there may be a simpler way to define this.
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = True
If Not Intersect(Target, Range("J1:J30000")) Is Nothing Then
Select Case Target.Value
Case "Complete"
SendOrderStatusComplete
End Select
End If
If Not Intersect(Target, Range("J1:J30000")) Is Nothing Then
Target.Offset(0, 1) = Date
End If
End Sub
I'm new to VBA but am trying to automate a spreadsheet to automatically send out an email when a cell value equals "Complete". The flow I have in mind is that when a dropdown value is selected "Complete", then the data from another cell will be copied into an email body and automatically sent to several addresses. So far, I only have subroutines set up to generate the email minus the data from the cells I need. Also, the range I have selected is for all cells in column J, but there may be a simpler way to define this.
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = True
If Not Intersect(Target, Range("J1:J30000")) Is Nothing Then
Select Case Target.Value
Case "Complete"
SendOrderStatusComplete
End Select
End If
If Not Intersect(Target, Range("J1:J30000")) Is Nothing Then
Target.Offset(0, 1) = Date
End If
End Sub