Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combobox to select worksheet

Status
Not open for further replies.

Lee24

Programmer
Apr 11, 2001
103
GB
Hi,

Can someone point me i the correct direction of how to use a combobox on sheet 1 of excel to automatically go to sheet 2 / 3 / 4 etc etc.

Many Thanks

L
 



Hi,

So the Sheet List hint was not good enough?

1. Make a list of worksheets and give it a Range Name. faq68-1331

2. Pick the cell you want the Drop Down in and Data > Validation -- LIST and enter the EQUALS sign, followed by your List Range Name. When users select this cell, a dropdown arrow will appear and you can make a selection.

3. Give this cell a Range Name. I'm calling mine, SelectedSheet

4. COPY this code. Right-Click the Sheet Tab and select View Code and PASTE into the code window.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Count > 1 Then Exit Sub
    If Not Intersect(Target, [SelectedSheet]) Is Nothing Then
        Sheets([SelectedSheet].Value).Activate
    End If
End Sub


Skip,
[sup][glasses]Don't let the Diatribe...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Hi, must be missing something here....

Is there anyway that the drop down arrow can be displayed on screen rather than appear when they click on it?

Also followed your instructions and nothing happens when I select an option.

Thanks

L
 



Also followed your instructions and nothing happens when I select an option.
Option WHERE?

Skip,
[sup][glasses]Don't let the Diatribe...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Sorry, when the user (me) clicks on the cell the list appears, when I select something from the list I thought it would open up the relevant worksheet?

sORRY
 



Did you paste the code into the sheet object as instructed?

Skip,
[sup][glasses]Don't let the Diatribe...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Yes...

The drop down works as I can see my worksheet names, just when i select one it changes in the box but that sheet does not open

do you have a working example you could send me?

thanks
 



Did you NAME the cell range where the Data Verification Drop Down box is, SelectedSheet?

Skip,
[sup][glasses]Don't let the Diatribe...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 


If you did those things AND you selected a valid sheet name. the procedure will activate the SelectedSheet.

Also, have you enabled MACROS in your workbook?

Skip,
[sup][glasses]Don't let the Diatribe...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
ah maybe enable macros, how do i do that?
 



Easiest way is to save and close.

Reopen and answer whatever question to enable macros as YES.

Skip,
[sup][glasses]Don't let the Diatribe...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Bingo......


Thanks, i am just going to a meeting just now i will let you know how i get on

Thanks Again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top