How to run a macro when a worksheet is selected

A

aristotle

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
 
B

Bob Phillips

Us

Private Sub Worksheet_Activate()
YourMacro
End Sub


--

HTH

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