Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Goto Sheet based on Cell Value
I am trying to write a macro that will go to a specific
sheet with the same name as the value of a cell. Ex. I have a cell that holds a drop down list with users names. I would like to select a user, say "eric", hit a botton that will take me to a sheet called "eric". Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Goto Sheet based on Cell Value
One way:
Public Sub Button1_Click() On Error Resume Next Worksheets(Range("A1").Text).Activate On Error GoTo 0 End Sub In article , "Eric" wrote: I am trying to write a macro that will go to a specific sheet with the same name as the value of a cell. Ex. I have a cell that holds a drop down list with users names. I would like to select a user, say "eric", hit a botton that will take me to a sheet called "eric". Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Goto Sheet based on Cell Value
Perfect. This worked just as I had hoped.
Can I add a little bit of complexity? If the destination sheet is password protected, is there a way to unprotect it with a password on the originating sheet? Ex. A user would have to enter a user name and a password on the starting (originating) sheet and the password would be incorporated into the macro to unprotect the destination sheet. Thanks -----Original Message----- One way: Public Sub Button1_Click() On Error Resume Next Worksheets(Range("A1").Text).Activate On Error GoTo 0 End Sub In article , "Eric" wrote: I am trying to write a macro that will go to a specific sheet with the same name as the value of a cell. Ex. I have a cell that holds a drop down list with users names. I would like to select a user, say "eric", hit a botton that will take me to a sheet called "eric". Thanks . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Goto Sheet based on Cell Value
Since XL's worksheet protection is so weak, I wouldn't advise that you
use it to limit who can make changes. Anyone with the gumption to find these newsgroups can find password breaking software, such as http://www.mcgimpsey.com/excel/removepwords.html Therefore, I'd recommend using a password only to prevent inadvertent changes, and using the same password for each sheet, doing something like: Public Sub Button1_Click() Const PWORD As String = "drowssap" On Error Resume Next With Worksheets(Range("A1").Text) .Activate .Unprotect PWORD End With On Error GoTo 0 End Sub In article , wrote: Perfect. This worked just as I had hoped. Can I add a little bit of complexity? If the destination sheet is password protected, is there a way to unprotect it with a password on the originating sheet? Ex. A user would have to enter a user name and a password on the starting (originating) sheet and the password would be incorporated into the macro to unprotect the destination sheet. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Goto last row of the sheet | Excel Worksheet Functions | |||
Goto or Find a Date in a Sheet | Excel Discussion (Misc queries) | |||
GoTo Worksheet based on which button clicked | Excel Programming | |||
Excel VBA (?!)-refer to a cell on Sheet to left of X, based on criteria on Sheet X | Excel Programming | |||
GOTO another sheet | Excel Programming |