Forum

Open Multiple URL's...
 
Notifications
Clear all

Open Multiple URL's within Cell Range of a Worksheet

3 Posts
2 Users
0 Reactions
114 Views
(@punith84)
Posts: 6
Active Member
Topic starter
 

Hi Myanda Treacy,

Trust you are doing well !

My name is Punith & I am from Chennai, India. I am a new user to Excel VBA

My reason to use Excel VBA is that, I wanted to open multiple web page based on the date present in a  cell range of a sheet.

In the attachment (Cell _Range.png), I have list of URL's in cell range D11 to D17. I would like to open these URL's in a default browser using Excel VBA.

I have attached a sample VBA code which works for Static URL Address. Please let me know the work around if the URL are referenced in cell.

Regards,

PunithCell_Range.png

[Image Can Not Be Found]

 
Posted : 26/04/2021 3:36 am
(@stentg)
Posts: 18
Eminent Member
 

Hi Punith,

Try this:

Sub OpenMultipleURLs()

Dim vURL
Dim ie As InternetExplorer
Dim iCount As Integer

Set ie = CreateObject("InternetExplorer.application")
ie.Visible = True

Range("D11").Select
iCount = 1
While ActiveCell.Value <> ""
vURL = ActiveCell.Value
If iCount = 1 Then
ie.Navigate vURL
Else
ie.Navigate vURL, CLng(2048)
End If

iCount = iCount + 1
ActiveCell.Offset(1, 0).Select
Wend

Set ie = Nothing
End Sub

Regards

Graham

 
Posted : 27/04/2021 4:22 am
(@punith84)
Posts: 6
Active Member
Topic starter
 

Hello Graham Stent,

Thank you for your reply.

When I first ran the above given code, I was facing a compilation error. I later understood, I need to check "Microsoft Internet Controls" in Tools -> References. With this change the code runs perfectly. Thank you very much for the time and effort Graham.

Regards,

Punith

 

image103.png

 
Posted : 27/04/2021 12:20 pm
Share: