Macro executes on Sheet change

  • Thread starter Thread starter k483
  • Start date Start date
K

k483

What's the correct syntax for getting a Macro to execute on changing t
a specific worksheet
 
I would probably use the sheet_activate event found by right clicking the
sheet tab>view code>worksheet>etc
 
Hi

Private Sub Worksheet_Activate()
Range("a1").Value = "Hi" 'or whatever you want
End Sub

this code goes against the sheet module of the specific worksheet that you
want to use to execute the code rather than in a "module", ie if the sheet
was called Sheet2, then in the VBE window, you would double click on Sheet2
in the project explorer and put your code there.

Cheers
JulieD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top