ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Contol toolbox command button (https://www.excelbanter.com/excel-discussion-misc-queries/124209-contol-toolbox-command-button.html)

eye59

Contol toolbox command button
 
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?

ChristopherTri

Contol toolbox command button
 
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

"eye59" wrote:

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?


Jon Peltier

Contol toolbox command button
 
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
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"eye59" wrote in message
...
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?





All times are GMT +1. The time now is 01:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com