Can I control Macro run automatically current worksheet?

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

Guest

I run a Macro in Excel 2003 with VBA, I want to run this Macro the current
worksheet, not other worksheet, even if others worksheet is opening. Can
anyone know how to control this macro run automatically appointed worksheet?
 
you could start you macro by activating the sheet you want ...or..

With Sheets("MySheet")
your code
End with
 
Instead of references to a specific sheet,
Use Activesheet to refer to the sheet. Use ActiveWorkbook to refer to
workbook containing the currently active 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