Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default (repost) Adding hyperlinks to VBA-generated worksheets

Hi,

I have code that generates worksheets from a list of worksheet names
inputted into either Column C or Column D. I would like to add hyperlinks
that link the values in either Column C or Column D (whichever column the
user chooses to enter the name) to the respective sheet that was generated.

The actual worksheet name entered into one of the two columns creates a
series of 6 pivot tables, and this entered value becomes their page filters.
All I want to
do is create the hyperlink to the generated sheets.

Here is the code that creates the sheets:

Worksheets("PIV_Template").Copy _
After:=Worksheets(Worksheets.Count)

Sheets("PIV_Template").Visible = False

Set sh = ActiveSheet
sh.Name = Target
For Each pt In sh.PivotTables
With pt
If Target.Column = 3 Then
With .PivotFields("ITBGrp")
For Each pi In .PivotItems
If LCase(pi.Value) = LCase(Target.Value) Then
.CurrentPage = pi.Value
End If
Next
End With
ElseIf Target.Column = 4 Then
With .PivotFields("IO_Grp")
For Each pi In .PivotItems
If LCase(pi.Value) = LCase(Target.Value) Then
.CurrentPage = pi.Value
End If
Next
End With
End If
End With
Next


I do know that the code below did the trick in another solution that I
developed previously, but I can't figure out how to adapt it to the code
above.


cell.Hyperlinks.Add Anchor:=cell, _
Address:="", _
SubAddress:="'" & ActiveSheet.Name & "'!A1", _
TextToDisplay:=cell.Value


Any help would be
--
Kent Lysell
Financial Consultant
Ottawa, Ontario
W: 613.948-9557
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
Adding hyperlinks to macro-generated sheets from list of sheet nam klysell Excel Programming 0 July 26th 07 08:04 PM
Summing Generated Worksheets mr tom Excel Programming 7 March 20th 07 03:19 PM
Difficulty adding RAND generated numbers 47u2caryj Excel Discussion (Misc queries) 2 November 20th 06 11:13 PM
Qualifying a generated value as unique across worksheets jloos Excel Discussion (Misc queries) 3 August 1st 06 09:54 PM
Trouble with hyperlinks (repost) [email protected] Excel Discussion (Misc queries) 2 March 23rd 06 05:55 PM


All times are GMT +1. The time now is 02:55 PM.

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"