Hi,
Need help I am new pretty new to VBA, created a worksheet it is working for 1 condition but I tried a lot but unable to make it work for the second condition in the same worksheet.
Background: The first code pasted below calls the I need to below code to call a macro when the condition1 cell changes to "Initaited" similarly I want it to call second macro in general module when the condition1 cell changes to "Completed"
<tbody>
</tbody>**Lets assume the colums are "N" for condition1 and column "S" for condition2 in the above case.**
I have written the code below but doesnt seem to work
Private Sub Worksheet_Change(ByVal Target As Range)
Dim LR As Long
LR = Range("N" & Rows.Count).End(xlUp).Row
'This assumes a Header Row in N1
If Not Intersect(Target, Range("N2:N" & LR)) Is Nothing Then
' If Target.Value = "Initiated" Then
Call Create_Mail_From_List(Target)
' End If
LR = Range("S" & Rows.Count).End(xlUp).Row
'This assumes a Header Row in S1
If Not Intersect(Target, Range("S2:S" & LR)) Is Nothing Then
' If Target.Value = "Initiated" Then
Call Create_Mail_From_List1(Target)
' End If
End If
End If
End Sub
Need help I am new pretty new to VBA, created a worksheet it is working for 1 condition but I tried a lot but unable to make it work for the second condition in the same worksheet.
Background: The first code pasted below calls the I need to below code to call a macro when the condition1 cell changes to "Initaited" similarly I want it to call second macro in general module when the condition1 cell changes to "Completed"
Name | Email address | Condition1 | Condition2 |
User1 | 1@c.com | Initiated | Completed |
User1 | 2@c.com | Initiated | Completed |
User1 | 3@c.com | Initiated | Completed |
<tbody>
</tbody>
I have written the code below but doesnt seem to work
Private Sub Worksheet_Change(ByVal Target As Range)
Dim LR As Long
LR = Range("N" & Rows.Count).End(xlUp).Row
'This assumes a Header Row in N1
If Not Intersect(Target, Range("N2:N" & LR)) Is Nothing Then
' If Target.Value = "Initiated" Then
Call Create_Mail_From_List(Target)
' End If
LR = Range("S" & Rows.Count).End(xlUp).Row
'This assumes a Header Row in S1
If Not Intersect(Target, Range("S2:S" & LR)) Is Nothing Then
' If Target.Value = "Initiated" Then
Call Create_Mail_From_List1(Target)
' End If
End If
End If
End Sub