Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default hyperlink to sheet name where sheet names=cell content

Can anybody tell me how to achieve the above. For instance, on sheet1 if
cell A1 contents are 'case 4576' i want to be able to click on cell A1/sheet
1 which will take me directly to a sheet named 'case 4576' - or to any sheet
name whereby the sheet name equals the content of cell A1.

Thks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 390
Default hyperlink to sheet name where sheet names=cell content

In , Banzai
spake thusly:

Can anybody tell me how to achieve the above. For instance, on
sheet1 if cell A1 contents are 'case 4576' i want to be able to
click on cell A1/sheet 1 which will take me directly to a sheet
named 'case 4576' - or to any sheet name whereby the sheet name
equals the content of cell A1.


Yes. I just did this this week. I posted about it in
microsoft.public.excel.misc, but here is that part of the
code. Not sure if this is the "canonical" way to do this,
and no one chimed in to tell me yes or no, but it does work.

Dim rgIndirect As Variant

' deleted code . . .

datRows = Application.CountA(Columns("D"))

' deleted code . . .


For myRow = 2 To datRows + 1

' value in cell is also a sheet name
rgIndirect = Cells(myRow, "A").Value & "!E2"

With Cells(myRow, "D")
.Activate
.Hyperlinks.Add Anchor:=Selection, Address:="", _
SubAddress:=rgIndirect, _
ScreenTip:=.Text 'from this cell
End With
Next 'myRow


The "rgIndirect" part and the .Hyperlinks.Add, specifically
the SubAddress property, are what you want, I think.
The ScreenTip part was just my own goal, but you might
not care about that part.

That other article of mine was here, fwiw:

Subject: VBA to add Tool Tips
Newsgroups: microsoft.public.excel.misc
Message-ID:
Date: Sun, 05 Aug 2007 13:17:00 -0000

-dman-
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
Content cell to determine which sheet to look at Mark Excel Discussion (Misc queries) 3 July 13th 07 01:13 PM
sheet tab = to cell content reaa Excel Discussion (Misc queries) 5 February 26th 07 07:06 PM
add up cell content to get answer at bottom of sheet Robert Excel Discussion (Misc queries) 1 July 11th 06 11:31 PM
add up cell content to get answer at bottom of sheet Robert Excel Discussion (Misc queries) 2 July 11th 06 10:18 PM
How to search and copy cell content to another sheet? Roel Excel Worksheet Functions 1 March 7th 05 01:56 PM


All times are GMT +1. The time now is 05:11 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"