View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_3_] Jim Thomlinson[_3_] is offline
external usenet poster
 
Posts: 983
Default Creating a drop down list

I assume you know how to add a drop down list to a cell. Data - Validaton -
List (add the sheet names)

I am assuming that you are putting that drop down into Cell B2. You can
change this in the code pretty easily. Here is the code you want to add.

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ErrorHandler
If Target.Address = "$B$2" Then Sheets(Target.Value).Select

Exit Sub
ErrorHandler:
MsgBox "Sheet " & Target.Value & " does not exist. Please Try again",
vbCritical, "Sheet Error"
End Sub

Right click the tab with the drop down and select view code. Paste this code
in and you are off to the races...

HTH

"Compnerd" wrote:

I need to create a drop down list, that when a user click on a selction it
will take the user to a certain worksheet in the workbook