Hyperlinks to files on computer not working in Pivot tables

SkyeS

New Member
Joined
May 21, 2015
Messages
40
Hey guys. Can someone please help me with this small issue I have. I know there is an easy fix I just dont know what it is.

I have an Excel sheet in which i update data frequently. I have 10 pivot tables for various things in one of my Excel workbooks and one of the columns have hyperlinks to some PDF files that are located on my computer. The hyperlinks work great on the original file that the pivot table pulls the data from but they dont work in the pivot tables, they just show up as text. I found this answer to a similar question of mine online but it isn't working for me and I'm not sure why.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
ActiveWorkbook.FollowHyperlink Target.Value, NewWindow:=True
End Sub

Thank you in advance to anyone who helps me!
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Right click your sheet - view code and simply copy the following code and paste it in there after the last line that start with “Option” (if any exist):
Code:
[COLOR=#3E3E3E]Private Sub Worksheet_SelectionChange(ByVal Target As Range)[/COLOR]    
If Target.Cells.Count = 1 Then
        On Error Resume Next
        ActiveWorkbook.FollowHyperlink _
            Address:=CStr(Target.Value), _
            NewWindow:=True
        On Error GoTo 0
    End If [COLOR=#3E3E3E]End Sub[/COLOR]
 
Upvote 0
Okay. I pasted it in each of the sheets that contain pivot tables. Its the only code on those sheets. My other code is a module. It still doesn't add the hyperlinks though. I'm sure it is something i am doing wrong but I'm not sure what. Any suggestions?
 
Upvote 0
okay so i figured out that instead of hyperlinking to the original hyperlink, it is linking to the project name. For example, I have the hyperlink to the project located in coln D but the project name in coln B and the hyperlinks are in coln B. It does not display as a hyperlink with underlined blue font. I can be okay with that but do you know why these will not work when I send the whole sheet as an email through vba code? or do you know how to fix that?
 
Upvote 0

Forum statistics

Threads
1,215,432
Messages
6,124,857
Members
449,194
Latest member
HellScout

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