Loop VBA function and Web IE

imgaur7

New Member
Joined
Dec 25, 2017
Messages
32
Hi,

I need help here to understand as how the loop function for Excel VBA works with the IE web page

for eg: In Excel I have 25 different web site address listed, so the VBA should open web page address in cell B2, wait IE to load, again wait for 5 sec and then close the current IE page and the go to cell B3 of excel to open a new web page.

(Simple steps)
Select B2 cell value (www.xxx.com) and open it in IE web page
wait for 5 sec to load the page
close the current IE page after 10 sec
and go to cell B3
...
... loop till last value in Cell B (loop until last value)


Thanks to all in advance
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Hi,

I need help here to understand as how the loop function for Excel VBA works with the IE web page

for eg: In Excel I have 25 different web site address listed, so the VBA should open web page address in cell B2, wait IE to load, again wait for 5 sec and then close the current IE page and the go to cell B3 of excel to open a new web page.

(Simple steps)
Select B2 cell value (www.xxx.com) and open it in IE web page
wait for 5 sec to load the page
close the current IE page after 10 sec
and go to cell B3
...
... loop till last value in Cell B (loop until last value)


Thanks to all in advance
----------------------------------------------------------
I tried something here and may be getting close to my code but problem here is that
it opens all the web pages one after another, instead of wait 5 sec and close current web page and then open next link in excel

Code:
Sub OpenLinks()
    Dim Cell As Range
    Set LinkRng = Range("A1").CurrentRegion.Columns(1)
    On Error Resume Next
    For Each Cell In LinkRng.Cells
        Cell.Hyperlinks(1).Follow
        Application.Wait (Now + TimeValue("00:00:05"))
            Next
    On Error GoTo 0
End Sub

Kindly suggest if possible here
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,301
Members
452,633
Latest member
DougMo

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