Link to home
Create AccountLog in
Avatar of fredgcook
fredgcook

asked on

How to create a dynamic hyperlink to a cell in a pivot table?

I am building a dashboard where difference sections reference multiple pivot tables. I enter the date for the dashboard in a cell (A8) and use that cell in the GetPivotData function (H1) to pull data for a specific month from the pivot table. Now I would like to be able to click a hyperlink in the same cell that has the GetPivotData formula (H1) and go to that part of the pivot table. Maybe I am missing an easier way to do this, but I have had difficulty creating a hyperlink that looks to another field for part of the string.  For example, I will enter 7/31/13 in cell A8.  I put A8 in the GetPivotData string so that cell H1 in my dashboard shows pivot table data for 7/31/13.  If I change cell A8 to 6/30/13, then the data in H1 in the dashboard automatically shows pivot table data for 6/30/13.  I would like the hyperlink in H1 to automatically go to the correct cell in the pivot table based on the date entered in cell A8.  Thanks for your help.
Avatar of Nick67
Nick67
Flag of Canada image

Are you able to post a sample workbook?
That may be why no one has yet tried to tackle your challenge :)

Is the  GetPivotData  function something that you have created in VBA.
It should be possible, if it is, to get it to simultaneously update the hyperlink.
Here is a sample, albeit a simple one.
H1 becomes a custom function call that uses A8 as a reference
It then calls GetPivotData for stuff on Sheet3 and updates a hyperlink in A8 to point to the row in the PivotTable that was retrieved.

Have a look at the VBA code-behind that makes it work.
Can you adapt it to your needs?
Dynamic-Hyperlink.xls
Avatar of fredgcook
fredgcook

ASKER

Nick67 - Thanks for the sample.  Will I have to write VBA code for every link?  I have attached a screen shot that shows several sections of the dashboard.  When complete, there should be a link for every cell with a value.
hyperlink-dashboard-1.JPG
ASKER CERTIFIED SOLUTION
Avatar of Nick67
Nick67
Flag of Canada image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer