There might be times when we need to open multiple links saved in an Excel file. Many users do not know that Excel has a feature to open multiple links at once. Hence, they open the links one by one.
This method is fine when the Excel file contains a few links. But if there are too many links in an Excel file, opening them one by one is not a good choice as it will take a lot of time. In this article, we will show you how to open multiple links from Excel at once.
How to open multiple links from Excel at once
To open multiple links from Excel at once, you have to insert a custom VBA script in your Excel sheet. Follow the instructions listed below:
1] Open the Excel file and right-click on the sheet tab in which you have saved the links. Click View Code. This will open a Microsoft Visual Basic window.
2] Copy the following code and paste it there.
Sub OpenHyperLinks() Dim xHyperlink As Hyperlink Dim WorkRng As Range On Error Resume Next xTitleId = "OpenHyperlinksInExcel" Set WorkRng = Application.Selection Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8) For Each xHyperlink In WorkRng.Hyperlinks xHyperlink.Follow Next End Sub
3] Now, close the Microsoft Visual Basic window and save your Excel file in Excel Macro-Enabled Workbook format. To select this format, click on the drop-down menu in the Save or Save As window.
4] Select all the cells containing the links that you want to open, right-click on the sheet tab, and select View Code. When the Microsoft Visual Basic window opens, press the F5 key and click OK. This will open all the selected hyperlinks in your default browser.
If you have saved hyperlinks in multiple sheets in an Excel file, you need not embed the VBS script into every sheet. Simply right-click on the particular sheet after selecting the hyperlinks, select View Code, and press the F5 key.
After that Excel will open a window containing the Macro that you have created earlier. Select the Macro and click on the Run button.
This will open all the selected hyperlinks saved in that particular Excel sheet.
Read: How to Navigate through a Microsoft Excel Worksheet.
Insert a button
You can also make this process simpler by inserting a button in the Excel sheet. After inserting the button, you simply have to click on it rather than opening the Microsoft Visual Basic window every time.
The following steps will help you with that:
1] First, you have to enable the Developer tab in Excel.
For this, go to “File > Options.” Now, click on the Customize Ribbon on the left pane and select the Developer checkbox on the right pane. Click OK to save the settings. After that, you will see the Developer tab on the menu bar of Excel.
2] Now, go to “Developer > Insert,” and click on the Button to insert it.
3] To draw the button, press and hold the left click of your mouse and drag it in the Excel worksheet. After that, a window will open automatically from which you have to select the Macro that you have just created. When you are done, click OK.
Rename the button if you want. Now, you can use this button to open the selected links.
Related post: Websites and extensions to open multiple URLs at once.