azizrasul
Well-known Member
- Joined
- Jul 7, 2003
- Messages
- 1,304
- Office Version
- 365
- 2019
- 2016
- Platform
- Windows
I have the following code
which I want to change to something like
as the value in C5 may change position to say D5 by a user but if I use the range name ("StartDate") then hopefully the code will still work!
When I use the latter code I get an error (argument not optional) on the .Range bit of
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$5" Then
Call Generate_Newlist
End If
End Sub
which I want to change to something like
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Range = Range("StartDate") Then
Call Generate_Newlist
End If
End Sub
as the value in C5 may change position to say D5 by a user but if I use the range name ("StartDate") then hopefully the code will still work!
When I use the latter code I get an error (argument not optional) on the .Range bit of
Code:
If Target.Range = Range("StartDate") Then