Macro Loop.

needhelp2

Active Member
Joined
Apr 19, 2011
Messages
250
Hello guys,

Today i am trying to make loop in below mentioned script that one process done then it moves from a1 row to a2 and b1 to b2 respectively.How i can make loop for it?

Thanks in advance.

Regards,
Smith.

Code:
Option Explicit
Private Sub forhome_Click()
Dim inputtext As Object
Dim core As ICoreVba
Dim browser As IBrowserVba
Set core = New myLib.core
Set browser = core.StartBrowser("http://myhomeweb.net")
Call browser.FindElementVba("input text", "id=username").inputtext(Range("a1"))
Call browser.FindElementVba("input password", "id=passwd").inputtext(Range("B1"))
Call browser.FindElementVba("button", "id=.save").Click
Call browser.FindElementVba("a", "text=Sign Out").Click

End Sub
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Code:
Option Explicit
Private Sub forhome_Click()
Dim inputtext As Object
Dim core As ICoreVba
Dim browser As IBrowserVba
Dim i As Integer
Set core = New myLib.core
Set browser = core.StartBrowser("http://myhomeweb.net")
For i = 0 to 1
    Call browser.FindElementVba("input text", "id=username").inputtext(Range("a1").offset(0,i))
    Call browser.FindElementVba("input password", "id=passwd").inputtext(Range("B1").offset(0,i))
    Call browser.FindElementVba("button", "id=.save").Click
    Call browser.FindElementVba("a", "text=Sign Out").Click
next i

End Sub
Give that a try. Basically, it just offsets everything by a column, and does it again.
 
Upvote 0

Forum statistics

Threads
1,224,537
Messages
6,179,408
Members
452,912
Latest member
alicemil

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