Pivot table with Hyperlinks

Sanath_p7

New Member
Joined
May 28, 2015
Messages
2
hi Friends,

Excel 2013. I am trying to have a pivot table with hyperlink features enabled using EXCEL VBA.

http://postimg.org/image/vz7ozq8qj/
vz7ozq8qj


So in the above picture you see the pivot table with two fields [ProjectName] & [ClicktoPR] displayed. I want to write a VBA code so that only [ProjectName] will be displayed and when clicked on [ProjectName] inside the pivot table. It should take us to the hyperlink associated with [ClicktoPR]

I am using VBA to create hyperlinks in pivot tables using the following code :

Code:
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;">[COLOR=#00008B]Private[/COLOR][COLOR=#00008B]Sub[/COLOR][COLOR=#000000] Worksheet_SelectionChange[/COLOR][COLOR=#000000]([/COLOR][COLOR=#00008B]ByVal[/COLOR][COLOR=#000000] Target [/COLOR][COLOR=#00008B]As[/COLOR][COLOR=#000000] Range[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000]
    [/COLOR][COLOR=#00008B]If[/COLOR][COLOR=#000000] Target[/COLOR][COLOR=#000000].[/COLOR][COLOR=#000000]Cells[/COLOR][COLOR=#000000].[/COLOR][COLOR=#000000]Count [/COLOR][COLOR=#000000]=[/COLOR][COLOR=#800000]1[/COLOR][COLOR=#00008B]Then[/COLOR][COLOR=#000000]
        [/COLOR][COLOR=#00008B]On[/COLOR][COLOR=#00008B]Error[/COLOR][COLOR=#00008B]Resume[/COLOR][COLOR=#00008B]Next[/COLOR][COLOR=#000000]
        ActiveWorkbook[/COLOR][COLOR=#000000].[/COLOR][COLOR=#000000]FollowHyperlink _
            Address[/COLOR][COLOR=#000000]:=[/COLOR][COLOR=#00008B]CStr[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]Target[/COLOR][COLOR=#000000].[/COLOR][COLOR=#000000]Value[/COLOR][COLOR=#000000]),[/COLOR][COLOR=#000000] _
            NewWindow[/COLOR][COLOR=#000000]:=[/COLOR][COLOR=#800000]True[/COLOR][COLOR=#000000]
        [/COLOR][COLOR=#00008B]On[/COLOR][COLOR=#00008B]Error[/COLOR][COLOR=#00008B]GoTo[/COLOR][COLOR=#800000]0[/COLOR][COLOR=#000000]
    [/COLOR][COLOR=#00008B]End[/COLOR][COLOR=#00008B]If[/COLOR][COLOR=#000000]
[/COLOR][COLOR=#00008B]End[/COLOR][COLOR=#00008B]Sub[/COLOR]</code>
 
Last edited:

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,215,863
Messages
6,127,394
Members
449,382
Latest member
DonnaRisso

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