How to call a macro from VBA sheet code?
I've seen it written elsewhere that you can call a macro from the 'Worksheet_Change' event. However when I try inserting the syntax:
Call My_Macro()
within the editor, this results in a dialog box that says "Click a Macro to run." When I click the named macro, the code executes.
However, outside of the editor, the complete code doesn't execute.
Example:
- REM Sheet Module
- Sub Worksheet_Change(ByVal Target As Range)
- Application.EnableEvents = false
- On Error Goto ENEV
- REM add your code below
- Call Do_Sort()
- ENEV:
- Application.EnableEvents = true
- End Sub