PDA

View Full Version : Solved: On sheet change macro.



ChrisJ
10-22-2010, 01:19 AM
Hi,
I have a requirement to have a macro run when ever someone clicks/or changes worksheet on the next tab within a workbook (which has many tabs). This is going to be a prompt that reminds them to do certain things when they are in that worksheet.

I remember this sometime ago, but cannot remember what actually activates a macro on worksheet change..

Cheers
Chris

Bob Phillips
10-22-2010, 01:22 AM
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
'do your stuff
End Sub


This is workbook event code.
To input this code, right click on the Excel icon on the worksheet
(or next to the File menu if you maximise your workbooks),
select View Code from the menu, and paste the code

ChrisJ
10-22-2010, 01:29 AM
Hi,
Many thanks for that... great.
Cheers
Chris