Macro autorunning

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
How can I get a certain macro run automaticly when selectin a certain
worksheet?
(excel 2003)
rgds, Pekka
 
Right click on the worksheet tab>view code>left window select
worksheet>right window select activate.
 
Thanks Don but still I have the same problem. The Macro (sub test()) do not
run automatically when selecting sheet2 unless I put put the macro in the
sheet2 VBA-area. What did I do wrong?
Pjotr

"Don Guillett" kirjoitti:
 
Pekka

Right-click on the sheet tab and "view code"

Copy/paste this into the module.

Private Sub Worksheet_Activate()
your_macro_name
End Sub

Gord Dibben Excel MVP
 
That's where to put it to have it run when you activate THAT sheet.
 

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