private sub worksheet_change(byval target as range) - in a Sheet

  • hi,


    I got a number of sheets in my file.
    In one of the sheet - I got a private sub worksheet_change(byval target as range), to capture timestamp.


    I also got a "All Clear" macro in a module.
    "All Clear" - marco clear all the cell value which user fill in the sheet.


    The issue I am having is when I run "All Clear" macro after that the private sub stop working.
    I have to close the file and open it again and it works file.


    I was thinking if there is a way to call "private sub worksheet_change(byval target as range)" written in a sheet from a Macro written in a Module.


    Hope someone can help.
    Thanks


    Saurabh

  • Did you turn off events before clearing data?

    Code
    1. Application.EnableEvents = False
    2. '[A1]="Hello World!
    3. Application.EnableEvents = True


    IF you want to call a Change events code, code the Change event to pass Target to a Module's Sub with input parameter Target as Range. The other Module Sub will then call the Module Sub by passing the Target too.