hi Friends,
Excel 2013. I am trying to have a pivot table with hyperlink features enabled using EXCEL VBA.
http://postimg.org/image/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 :
Excel 2013. I am trying to have a pivot table with hyperlink features enabled using EXCEL VBA.
http://postimg.org/image/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: