How to run a macro when a worksheet is selected

  • Thread starter Thread starter cpmittal
  • Start date Start date
Hi,

This works whenever a change is made within a worksheet, will it do?

Go to VBE (Alt + F11). Find the sheet you want to apply this to within
Project-VBA Project. Double click the sheet and paste:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
YourMacro
End Sub

Change "YourMacro" to the code you want to run.

Regards,
A
 
Us

Private Sub Worksheet_Activate()
YourMacro
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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