nparsons75
Well-known Member
- Joined
- Sep 23, 2013
- Messages
- 1,254
- Office Version
- 2016
Hi,
I have a worksheet change event that works perfectly as is. Basically it looks for a change within a range and then name and time stamps in to seperate cells. What I need is to have this work numerous times, so I have multiple ranges, and multiple name and time stamp cells per each range. My current code is:
I thought I would try this but the second change overides the first.
Thanks in advance for any help.
I have a worksheet change event that works perfectly as is. Basically it looks for a change within a range and then name and time stamps in to seperate cells. What I need is to have this work numerous times, so I have multiple ranges, and multiple name and time stamp cells per each range. My current code is:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)ActiveSheet.Unprotect Password:="******"
Application.EnableEvents = False
If Intersect(Target, Range("A14:z35")) Is Nothing Then Exit Sub
Range("e35").Value = Environ("UserName")
Range("k35").Value = Now
ActiveSheet.Protect Password:="******"
Letscontinue:
Application.EnableEvents = True
Exit Sub
End Sub
I thought I would try this but the second change overides the first.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)ActiveSheet.Unprotect Password:="oeestat"
Application.EnableEvents = False
If Intersect(Target, Range("A14:z35")) Is Nothing Then Exit Sub
Range("e35").Value = Environ("UserName")
Range("k35").Value = Now
If Intersect(Target, Range("B42:Z55")) Is Nothing Then Exit Sub
Range("e10").Value = Environ("UserName")
Range("k10").Value = Now
ActiveSheet.Protect Password:="oeestat"
Letscontinue:
Application.EnableEvents = True
Exit Sub
End Sub
Thanks in advance for any help.