Hey guys, I am trying to write for a worksheet change event for two non contiguous range , which are cells A&lastrow and C&lastrow. For example, if lastrow=5, then it is A5, and C5, while excluding B5. This is my code, and it is not working, any idea on how to fix the syntax.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim lastrow As Long
lastrow = 5
If Not Intersect(Target, Range("A & lastrow, C & lastrow ")) Is Nothing Then
MsgBox "Hello"
End If
End Sub
Bookmarks