Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default 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   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default 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
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
Goto last row of the sheet Elton Law[_2_] Excel Worksheet Functions 3 April 10th 09 02:55 PM
Goto or Find a Date in a Sheet Kev - Radio Man Excel Discussion (Misc queries) 1 March 28th 08 09:40 AM
GoTo Worksheet based on which button clicked Paul Martin Excel Programming 2 July 6th 04 06:22 AM
Excel VBA (?!)-refer to a cell on Sheet to left of X, based on criteria on Sheet X tempjones Excel Programming 2 June 7th 04 09:48 PM
GOTO another sheet CLR[_2_] Excel Programming 4 April 23rd 04 09:26 PM


All times are GMT +1. The time now is 06:51 PM.

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"