• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

pivot table must be hyperlinked to internal files

Joy888

New Member
Hi, please help me with the code. The P.O. no in my pivot table must be hyperlinked to internal files (e.g PDF.)
 

Attachments

  • MONITORING- sample.xlsx
    35.3 KB · Views: 5
You won't get true hyperlinks in a pivot table.
But you can do this:

You will need to adapt the following already adapted code from that link to suit yourself:
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim selPF As PivotField, strField As String, strAdd As String, myVal As String

strField = "P.O.  NO."
On Error Resume Next
Set selPF = Target.PivotField
If Not selPF Is Nothing Then
  If selPF.Name = strField Then
    myVal = Target.Value
    If Len(myVal) > 0 Then ThisWorkbook.FollowHyperlink Address:="C:\Users\blah\Documents\" & myVal & ".pdf", NewWindow:=True
  End If
End If
End Sub
 
Hi, Thank you so much for your reply. I tried the code but it didn't work for me. :(
I'm sorry Im not good with coding. Hope you can help me. The P.O No. on the Source sheet is link to a pdf file and on the pivot table I want to create a fake hyperlink so that everytime I click the P.O No. the particular pdf file will open.
 

Attachments

  • MONITORING- sample.xlsm
    52.3 KB · Views: 2
Back
Top