Request for Help: VBA, Hyperlinks, and Pivot Tables

Karelia

New Member
Joined
Jun 12, 2015
Messages
5
Hello,

Ok, I have been playing around with the VBA stuff in excel by what I have researched online to make hyperlinks work in a pivot table but I am having trouble getting this to work.

Here is my situation:
> Source Data has a column with the text "Edit Funding" for each row.
> The "Edit Funding" text is hyperlinked to another worksheet within the workbook.
> The pivot table has several columns of data but one of those columns is the "Edit Funding" column in which I would like for the hyperlink that is active in the source data to be active in the pivot table.
> I have slicers in the pivot table so having the hyperlinks active in the pivot table is essential to the functionality of this workbook.

Example:
COL A COL B COL C COL D
NAME ACCOUNT ACCOUNT BALANCE EDIT FUNDING
John Doe 123456 $35,000 Edit Funding
Janice Cat 234567 $37,000 Edit Funding

So, the Edit Funding Column (Column D in the example above) is in the source data, linked to other worksheets - I would like for this column to be brought into my pivot table with the hyperlinks intact.

Here is what I am using as the code (and I am very new to using VBA so I know this is wrong but I don't know how to fix it):
(And if any better suggestions for a code is available, I would very much appreciate your assistance in creating this!)

---------------
Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim ptc As PivotTable
'Find every PivotTable in ActiveSheet
For Each ptc In ActiveSheet.PivotTables
'Check if selected cell is a pivot table cell
If Not Intersect(Target, Range(ptc.TableRange1.Address)) Is Nothing Then
'Check if the cell value begins with EditFunding
If Left(Target.Value, 8) = "Edit Funding" Then
'Follow hyperlink using cell value as hyperlink address
ActiveWorkbook.FollowHyperlink Address:=Target.Value, NewWindow:=True
End If
End If
Next ptc


End Sub
--------------------------

Thank you for your time!


 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Did you find a solution to this problem?
if i try with a weblink i.e. 'http:\' the link works if i click on the cell in pivot table.
but it just dont happen with navigating between sheets :eek:
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,551
Members
449,088
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top