Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Creating a drop down list

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Creating a drop down list

I create a drop down list, but I cannot find tab to that says view code?

"Jim Thomlinson" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Creating a drop down list

Sorry about taking so long to get back to you. I was gone for lunch. There
are tabs at the bottom of the spreadsheet, which you can select to move from
sheet to sheet. If you right click on the tab you will get a menu allowing
you to Insert, Rename, Copy... The last item should be view code. If that
still is not working for you then you can go in through the VB Editor. Alt +
F11 is the quick way to get there. Once in the VBE on the left hand side you
should have a project explorer. double click the sheet you want and paste
the code...

HTH

"Compnerd" wrote:

I create a drop down list, but I cannot find tab to that says view code?

"Jim Thomlinson" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Creating a Drop Down List from a List in another worksheet Pat Excel Discussion (Misc queries) 1 November 25th 08 06:44 PM
creating a drop down list Brian Dsilva New Users to Excel 3 July 25th 08 11:31 PM
Creating a drop down list bethjoy79 Excel Discussion (Misc queries) 6 November 13th 07 07:11 PM
Creating a drop down list from another drop down Jody Excel Discussion (Misc queries) 2 March 8th 06 08:14 PM
creating a drop down list Katherine[_6_] Excel Programming 1 August 24th 04 01:24 AM


All times are GMT +1. The time now is 01:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"