How To Add Hyperlinks in Excel Using Formula?
Higher version of MS Excel like 2007 or above have built in function to add links.- Select a cell to insert a hyperlink.
- Enter “=HyperLink” & enter value for below parameters.
- Type website URL address or destination file path as link.
- Type any text to display as friendly name in Excel.
- Example: =HYPERLINK (“https://officetricks.com”, “Refer Officetricks for Excel Tips”)
- Press Enter.
How To Add Hyperlinks in Excel using VBA?
The below code has sample VBA to add website Url & also file path as hyperlink. Open a new workbook, press Alt+F11 & copy paste this below code. Once you press F5, it will add hyperlinks in active sheet.Sub Excel_VBA_Insert_Hyperlink()
'VBA Code to Add Website URL as Hyperlink in Excel
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
"http://officetricks.com/", TextToDisplay:="Refer Officetricks.com for Excel Tips"
'VBA Code to Add Website URL as Hyperlink in Excel
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
"D:\FolderPath\Filename.jpeg", TextToDisplay:="Filepath To Open"
End Sub
Above code will add hyperlinks twice in the same cell. To avoid this, enter a different location in second command. For example: instead of 'Activesheet.Hyperlinks' use 'Thisworkbook.Sheets(1).Cells(1,2).Hyperlinks'
How To Read All Hyperlinks in Excel using VBA Macro?
Use this VBA code to read all the Hyperlinks in Your Excel sheet.Sub Excel_Read_All_Hyperlinks_VBA()
Dim idx As Integer
'Read All Hyperlinks in Worksheet
For idx = 1 To ActiveSheet.Hyperlinks.Count
MsgBox ActiveSheet.Hyperlinks(idx).Address
Next
End Sub
How to Add hyperlink in Excel Manually?
To insert a hyperlink in Excel follow these steps.- Right click cell.
- Choose "Hyperlink" in menu.
- Type value for "Text to display" field.
- Enter "Address" or choose a path from Existing File or Web page.
- Click 'Ok'.