Command button

SpecialK

New Member
Joined
Aug 24, 2002
Messages
5
I want to add a button on a worksheet so when I click the button it will go to another sheet. Can I do that?
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
I think that's simple enough. If you don't know where to start, here's how:

Click on VIEW, TOOLBARS, and CONTROLBOX.
Select the Command button option and place it on your worksheet.
Doubleclick it and the following will appear:

Private Sub CommandButton1_Click()

End Sub


In between the ComandButton_Click and End Sub, type this:

Sheets("Your sheet name here").Select


That's it! Your sheet name will have to be between quotation marks as shown.
This message was edited by Drmwvr7266 on 2002-08-25 05:46
 
Upvote 0
Private Sub CommandButton1_Click()

Sheets("Your sheet name here").Select

End Sub

Does your code look like this?VB is particular about the way you write it. You need to make sure it is written correctly. If your sheet name is, say, Sheet1, then it should read:
Sheets("Sheet1").Select.

Note: After the ("Sheet1") is a period, then SELECT.
This message was edited by Drmwvr7266 on 2002-08-25 05:56
 
Upvote 0

Forum statistics

Threads
1,224,317
Messages
6,177,850
Members
452,810
Latest member
jeffrey0409

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top