Run macro if user goes to a specific worksheet

D

Danielle

I have a workbook with several worksheets. There is on worksheet that I want
to run a macro on if the user of the worksheet goes to it.

Any ideas?
 
J

Jacob Skaria

Place the below as the first line of the macro.

If Environ("Username") <> "username" Then Exit Sub

If this post helps click Yes
 
J

Jacob Skaria

Oops....Use the Worksheet_Activate event...Right click sheet tab>View code and

Private Sub Worksheet_Activate()

End Sub

If this post helps click Yes
 
Top