Macro executes on Sheet change

K

k483

What's the correct syntax for getting a Macro to execute on changing t
a specific worksheet
 
D

Don Guillett

I would probably use the sheet_activate event found by right clicking the
sheet tab>view code>worksheet>etc
 
J

JulieD

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
 
Top