Hyperlink A Column

Kentexpress

New Member
Joined
Mar 12, 2021
Messages
5
Office Version
  1. 365
Platform
  1. Web
Hi All,

I want to try and hyperlink a whole column which links to a single document in a folder, once I've added the information to a spreadsheet, I have come across a spreadsheet which does this. From my snapshot of the sheet, I have different information in the cells of the column but when you click on any of the column cells (even ones which do not have any text in blue) you are directed to the correct document. Each individual column is a single different document and each blue cell of my spreadsheet contains different information contained in the document.

Many thanks!
 

Attachments

  • Screenshot 2021-04-26 095539.png
    Screenshot 2021-04-26 095539.png
    5.9 KB · Views: 9

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Not sure if this is what you are after or if I got the wrong end of the stick, but you can open a file when any cell in column A is clicked on.

In this case the location is C:\junk\test.pdf
The code goes in the relevant sheet not a module.

It does throw up a warning about viruses when opening files of other applications. Not sure of an easy way around that.
You can repeat code for different columns.

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim ColACells As Range

        LastRow = ActiveSheet.Range("A:A").Rows.Count
 
' ColCells are the cells of column A that will cause the hyperlink to open. In this case any cell.
        Set ColACells = Range("A1:A" & LastRow)
 
        If Not Application.Intersect(ColACells, ActiveSheet.Range(Target.Address)) Is Nothing Then
        
        ActiveWorkbook.FollowHyperlink Address:="file:///C:\junk\test.pdf", NewWindow:=True

        End If
  End Sub
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,583
Members
449,089
Latest member
Motoracer88

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