Contol toolbox command button

G

Guest

I am trying to set up a 'main menu' spreadsheet in a work book this contains
command buttons ONLY which navigate to other spreadsheets within the workbook
or other workbooks. I set up up the command buttons via the control toolbox
command button option and inserted hyperlinks to the spreadsheets or
workbooks I want to go to. BUT when I exit design mode inthe contol toolbox
the command buttons don't work. What am I doing wrong? This seemed so much
easier that using the command button in the forms toolbar and creating
macros. Also when I use the command button in forms toolbar I am unable to
change the background of the command button? I can change the font but not
the putty background?
 
G

Guest

Not sure where you are entering the hyperlink...

I think that you will still have to use VBA to navigate around you workbook.
Using command buttons from the controls toolbar should be you best bet.

in design mode, create and double-click on the button you want to program.
Modify the following code (sheet names and workbook name) to get to the right
destination. The first code sends you to a sheet in the same workbook. The
second sends you to a selected sheet in a different workbook.

Private Sub CommandButton1_Click()
Sheets("Sheet2").Select
End Sub

Private Sub CommandButton2_Click()
Windows("Book2.xls").Activate
Sheets("Sheet1").Select
End Sub

One final note, this code assumes that "Book2.xls" is already open.

For more information on checking to see if a file is already open see the
following:

http://support.microsoft.com/kb/138621/en-us

Regards...

ChristopherTri
 
J

Jon Peltier

The hyperlink is in a cell; clicking on the cell jumps to the target. The
command button is redundant, and you'd be better without it.

- Jon
 

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