How to Activate Multiple Hyperlinks in Excel (4 Ways)

In the following dataset, we have a list of some famous e-commerce sites and their website addresses. The website links are not activated so they cannot be opened by clicking on these links. Let’s activate them as hyperlinks.

how to activate multiple hyperlinks in Excel

We have used Microsoft Excel 365 version here, but you can use any other versions at your convenience.


Method 1 – Using HYPERLINK Function

We can activate the links using the HYPERLINK function, but we’ll have to store the hyperlinks in a new column, Linked Address.

how to activate multiple hyperlinks in Excel

Steps:

  • Select the range of the Linked Address column.

HYPERLINK function

  • Enter the following formula in D4, the first cell of the selected range:
=HYPERLINK(C4)

HYPERLINK will activate the text URL in cell C4.

  • Press CTRL+ENTER.

HYPERLINK function

All of the hyperlinks will be activated in the Linked Address column at once. Simply click the links to visit the websites.

how to activate multiple hyperlinks in Excel

Read More: How to Hyperlink Multiple Cells in Excel


Method 2 – Activate Multiple Hyperlinks Using VBA Selection Property

We can use a VBA code with the Selection property to activate the links in the Website Link column itself just by selecting them.

how to activate multiple hyperlinks in Excel

Steps:

  • Go to the Developer Tab >> Visual Basic Option.

Selection property

The Visual Basic Editor will open up.

  • Go to the Insert Tab >> Module Option.

Selection property

A Module will be created.

how to activate multiple hyperlinks in Excel

  • Enter the following code in the module window:
Sub activatinglinks()
Dim w_link As Variant
For Each w_link In Selection
ActiveSheet.Hyperlinks.Add Anchor:=w_link, Address:=w_link.Formula
Next w_link
End Sub

Here, we declared w_link as a Variant. The FOR loop iterates through each cell w_link of our selection and uses the HYPERLINKS function to activate each of the text URLs in this range.

Selection property

  • After saving the code, return to the main sheet.
  • Select the range of the text URLs in the Website Link column.
  • Go to the Developer Tab >> Macros Option.

Selection property

The Macro dialog box will open up.

  • Select the macro activatinglinks.
  • Click Run.

Selection property

The macro returns activated hyperlinks in the Website Link column.

how to activate multiple hyperlinks in Excel

Read More: Excel Hyperlink with Shortcut Key


Method 3 – Using VBA InputBox Method to Activate Multiple Hyperlinks

For more flexibility in selecting which links to activate, we can use the InputBox method in VBA to create an input box in which we can select and activate multiple hyperlinks simultaneously.

how to activate multiple hyperlinks in Excel

Steps:

  • Follow the Steps of Method 2 to open a module window.
    Enter the following code:
Sub enablinglinks()
Dim w_link As Variant
Dim multiple_links As Range
Box = "Activation of Links"
Set multiple_links = Application.Selection
Set multiple_links = Application.InputBox("Select the Range of URL's", _
Box, multiple_links.Address, Type:=8)
For Each w_link In multiple_links
ActiveSheet.Hyperlinks.Add w_link, w_link.Value
Next w_link
End Sub

Here, we declared w_link as Variant and multiple_links as Range. Then we defined the title of the input box as Activation of Links which is stored in the Box, set multiple_links to the range from which we will be selecting, and assigned the InputBox method to the multiple_links.
A FOR loop is then iterates through each cell w_link of the selected range multiple_links using the HYPERLINKS function to activate each of the text URLs in this range.

InputBox method

  • Press F5 to run the code.
  • In the input box that appears, select the range of the hyperlinks $C$4:$C$12 in the Select the Range of URL’s box.
  • Press OK.

InputBox method

The macro activates all the hyperlinks of the Website Link column.

InputBox method

Read More: How to Hyperlink Multiple PDF Files in Excel


Method 4 – Activating Hyperlinks by Declaring a Range

Another approach to activating multiple hyperlinks simultaneously is to declare a range for the hyperlinks in a VBA code.

how to activate multiple hyperlinks in Excel

Steps:

  • Follow the Steps of Method 2 to open a module window.
  • Enter the following code:
Sub enablinglinks1()
Dim w_link As Variant
Dim multiple_links As Range
Set multiple_links = Range("C4:C12")
For Each w_link In multiple_links
ActiveSheet.Hyperlinks.Add w_link, w_link.Value
Next w_link
End Sub

Here, we declared w_link as Variant and multiple_links as Range, then set multiple_links to the range C4:C12.
The FOR loop cycles through each cell w_link in the defined range multiple_links and uses the HYPERLINKS function to activate each of the text URLs in this range.

Declaring a range

  • Press F5 to run the code.

The macro converts the text URLs into activated hyperlinks in the Website Link column.

Declaring a range

Read More: How to Create a Hyperlink in Excel


Download Workbook


Related Articles

<< Go Back To Hyperlink in Excel | Linking in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Tanjima Hossain
Tanjima Hossain

TANJIMA HOSSAIN is a marine engineer who enjoys working with Excel and VBA programming. For her, programming is a handy, time-saving tool for managing data, files, and online tasks. She's skilled in Rhino3D, Maxsurf C++, MS Office, AutoCAD, and Excel & VBA, going beyond the basics. She holds a B.Sc. in Naval Architecture & Marine Engineering from BUET and is now a content developer. In this role, she creates tech-focused content centred around Excel and VBA. Apart from... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo