LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default (repostX3) Adding hyperlink to macro-generated pivot table

Hi,

I'm trying to create a hyperlink each time a user enters in a code in either
column C or D that ilnks this code in the active cell to the respective
VBA-generated pivot table.

Here is a fragment of the code that I have so far. You can see that my lame
attempts aren't working. This is the third time that I've posted this
question as I am determined to solve my problem.

Dim pi As PivotItem
Dim sh As Worksheet
Dim pt As PivotTable
Dim cell As Range

If Target.Count 1 Then Exit Sub
If Len(Trim(Target)) = 0 Then Exit Sub
If Target.Column = 3 Or Target.Column = 4 Then

If Target.Column = 3 Then

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

Set cell = ActiveCell
Set sh = ActiveSheet
sh.Name = Target
For Each pt In sh.PivotTables
With pt
With .PivotFields("ITBGrp")
For Each pi In .PivotItems
If LCase(pi.Value) = LCase(Target.Value) Then
..CurrentPage = pi.Value

With sh
..Hyperlinks.Add Anchor:=.Range("Cell"), Address:="", _
SubAddress:="pi.value", TextToDisplay:=pi.Value
End With

End If
Next
End With
End With
Next

Thanks in advance for anyone's amazingly appreciated help!

--
Kent Lysell
Financial Consultant
Ottawa, Ontario
W: 613.948-9557
 
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
Pivot Table Data Adding contents of two pivot tables and param que Roundy Excel Discussion (Misc queries) 0 July 2nd 07 10:20 PM
pivot table generated from whole columns (eg B:K) RichHoughton Excel Discussion (Misc queries) 1 February 11th 07 02:28 AM
zeros generated by a calculated item in pivot table Frederic Excel Worksheet Functions 3 October 27th 05 01:22 PM
Adding Hyperlink to Pivot Table data [email protected] Excel Worksheet Functions 0 October 21st 05 09:52 PM


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