convert data to a link

RodneyW

Active Member
Joined
Sep 24, 2010
Messages
433
Office Version
  1. 2013
Platform
  1. Windows
In column B I have a list of about 4000 file names and their location on my computer, to be precise, it's on an external hard drive. As examples:

E:\Drive 2\purple
E:\Drive 2\green.mp4

Note the first file name/location does not include the file extension but the second one does.

The goal is to have all 4000 entries in column B serve as a link so if I click it, it opens the selected file. I can do this manually, entry by entry "simply" by right clicking the file name, selecting "Hyperlink" from the menu and mapping it out. As you can imagine, this would be very laborious. Is there a better way to do this?

Thanks in advance
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
In column B I have a list of about 4000 file names and their location on my computer, to be precise, it's on an external hard drive. As examples:

E:\Drive 2\purple
E:\Drive 2\green.mp4

Note the first file name/location does not include the file extension but the second one does.

The goal is to have all 4000 entries in column B serve as a link so if I click it, it opens the selected file. I can do this manually, entry by entry "simply" by right clicking the file name, selecting "Hyperlink" from the menu and mapping it out. As you can imagine, this would be very laborious. Is there a better way to do this?

Thanks in advance
in that way, you can use
Excel Formula:
=HYPERLINK("your link")
formula to do it
 
Upvote 0
Here is a VBA solution. Test on a Copy of your Workbook as unexpected results may occur.
VBA Code:
Sub Change2Hyperlink()
Dim wb As Workbook, sht As Worksheet, rng As Range, cell As Range, lRow As Long
Set wb = ThisWorkbook: Set sht = wb.Sheets("YourSheetName") 'Change to match your Sheet Name
lRow = sht.Rows.End(xlDown).Row
Set rng = sht.Range("A1:A" & lRow)
For Each cell In rng
    sht.Hyperlinks.Add Anchor:=cell, Address:=cell.Value, TextToDisplay:=cell.Value
Next cell
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,113
Messages
6,123,165
Members
449,099
Latest member
bes000

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