Can I trigger a Worksheet_Change event macro from a standard macro?
IOW:
Code: Select all
Sub ForceUpDate()
Application.EnableEvents = True
Call Worksheet_Change
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
....
End Sub
Code: Select all
Sub ForceUpDate()
Application.EnableEvents = True
Call Worksheet_Change
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
....
End Sub
Code: Select all
Application.Run "Sheet1.Worksheet_Change", Sheet1.Range("A1")
The event macro is using EnableEvents = False and then True at end.rory wrote:It would be bad design, in my opinion, to ever need to do that. It implies that the code being run by the change event should actually be a routine in a normal module called from both other pieces of code.