Archive of Mr Excel Message Board

Back to Controls in Excel archive index
Back to archive home

another combo problem
Posted by Mike on January 18, 2002 1:58 PM
I'm making a basketball stat sheet for a little league team and I have the individual game stats, each on a different work sheet. I have a combo box that lists all the teams we play, but I don't know how to make the selection in the combo box bring me to the specific sheet that holds the game stat.

Re: another combo problem
Posted by Russell Hauf on January 18, 2002 3:50 PM
Can you tell me what kind of combo box you have? Is it on a UserForm or on a sheet? If it's on a sheet, did you insert it from the Forms toolbar or the Control Toolbox?
What I would do is to use a combo box from the control toolbar. After you have assigned each sheet name to your combo box, double-click on the combo box (while still in design view). This should take you to the code window and insert the ComboBox1_Change() event. You can enter the following:
Private Sub ComboBox1_Change()
Sheets(ComboBox1.Text).Select
End Sub
Again, you need to make sure that the values in your combo box are spelled exactly like the sheets.
Hope this helps,
Russell

This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our
online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.