#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 58
Default Goto Tab

Is there a way for a macro to goto a Tab that is listed in a cel.
Example:

A5 has the name Jay and I want to goto the Jay tab.

Thanks in advance


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default Goto Tab

Ed,

Try code like

On Error Resume Next
With ThisWorkbook.Worksheets
.Item(.Item("Sheet1").Range("A5").Value).Select
End With
If Err.Number < 0 Then
MsgBox Err.Description
End If

It reads the contents of A5 on Sheet1 and activates the sheet named in that
cell.


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)




"Ed Davis" wrote in message
...
Is there a way for a macro to goto a Tab that is listed in a cel.
Example:

A5 has the name Jay and I want to goto the Jay tab.

Thanks in advance



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 58
Default Goto Tab

This workes great.
Thank You


"Chip Pearson" wrote in message
...
Ed,

Try code like

On Error Resume Next
With ThisWorkbook.Worksheets
.Item(.Item("Sheet1").Range("A5").Value).Select
End With
If Err.Number < 0 Then
MsgBox Err.Description
End If

It reads the contents of A5 on Sheet1 and activates the sheet named in
that cell.


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)




"Ed Davis" wrote in message
...
Is there a way for a macro to goto a Tab that is listed in a cel.
Example:

A5 has the name Jay and I want to goto the Jay tab.

Thanks in advance




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default Goto Tab

I know the OP has an answer, but I wanted to post (for the archives) a
method that does not require error checking...

Dim WS As Worksheet
For Each WS In Worksheets
If WS.Name = Worksheets("Sheet1").Range("A5").Value Then
WS.Select
Exit For
End If
Next

--
Rick (MVP - Excel)


"Ed Davis" wrote in message
...
Is there a way for a macro to goto a Tab that is listed in a cel.
Example:

A5 has the name Jay and I want to goto the Jay tab.

Thanks in advance



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 (F5) question dford Excel Discussion (Misc queries) 2 January 13th 07 05:54 AM
GOTO with Macros PBallia Excel Discussion (Misc queries) 1 September 18th 06 01:37 AM
Goto code Bob Excel Discussion (Misc queries) 4 July 6th 06 06:44 PM
Excel GOTO joeski Excel Discussion (Misc queries) 3 May 10th 06 01:06 PM
If.....Then GoTo....... Alec H Excel Discussion (Misc queries) 4 February 22nd 06 03:42 PM


All times are GMT +1. The time now is 04:47 AM.

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

About Us

"It's about Microsoft Excel"