Navigate Sheets using In-Sheet Combo Boxes

I

imitk

I've got a menu ComboBox and I want selecting an item to activate a
corresponding sheet in the workbook. Thinking of writting a macro that
calls several subsequent macros (already written) that activate the
sheets, but I'm a little fuzzy on coding for In-sheet controls.
Suggestions?

imitk
 
K

Ken

It may not be exactly what you want, but Bill Gates already gave us
something that does pretty much what you have described. If you right
click on the arrow keys that are jst to the left of the sheet names you
get basically a list box with all the sheets. You pick the on you want
and spare yourself the macro writing. If you really want it in a
Combobox, you can insert a combobox from the Control Toolbar on your
worksheet, and associate this code with it

Private Sub ComboBox1_Click()
ws = ComboBox1.ListIndex
Worksheets(ws + 1).Activate
End Sub

Private Sub ComboBox1_GotFocus()
ComboBox1.Clear
For Each ws In Worksheets
ComboBox1.AddItem ws.Name
Next ws
End Sub

Good luck.

Ken
Norfolk, Va
 

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