Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help Creating a Drop Down List from a List in another worksheet | Excel Discussion (Misc queries) | |||
creating a drop down list | New Users to Excel | |||
Creating a drop down list | Excel Discussion (Misc queries) | |||
Creating a drop down list from another drop down | Excel Discussion (Misc queries) | |||
creating a drop down list | Excel Programming |