Opening multiple hyperlinks in order from Excel

Onebracketshort

New Member
Joined
Dec 19, 2019
Messages
37
Office Version
  1. 2010
Platform
  1. Windows
Have 3,000 odd hyperlinks in an Excel sheet that I would like to open in chrome so I can view the data on each page.

The cells are opening in chrome but in a random order when I run this VBA module:

Sub OpenHyperLinks()
'Update 20141124
Dim xHyperlink As Hyperlink
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
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


Disclaimer: I didnt write this code I took it from a web article.

It almost does the job but I really could do with the pages opening in the descending order they appear in their Excel column.

Is there an edit to this module that would effect this change?

Thanks for taking a look
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
VBA Code:
Sub OpenHyperLinks()
'Update 20141124 (modified)
    'Dim xHyperlink As Hyperlink
    Dim WorkRng   As Range, cell As Range
    On Error Resume Next
    xTitleId = "KutoolsforExcel"
    Set WorkRng = Application.Selection
    Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
    For Each cell In WorkRng.Cells
        cell.Hyperlinks(1).Follow
    Next
End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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