go to worksheet on button name

N

Northern Dave

I am trying to assign a macro to a button so that when clicked it opens the
worksheet whose name is on the button
 
S

Stefi

Copy this event sub in the code window of worksheet containing the button:

Private Sub CommandButton1_Click()
Worksheets(Me.CommandButton1.Caption).Select
End Sub

Regards,
Stefi

„Northern Dave†ezt írta:
 

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

Top