Excell to Web Form filling macro

Joined
Mar 2, 2015
Messages
1
Reaction score
0
I have excel data sheet that have lot of data. i need to fill those data in to web form individually. i created a macro for fill this data but i need to loop this macro with all raws in excel. can you please help me....

Sub FillInternetForm()
Dim IE As Object
Dim counter
Set IE = CreateObject("InternetExplorer.Application")
'create new instance of IE. use reference to return current open IE if
'you want to use open IE window. Easiest way I know of is via title bar.
IE.Navigate "http://www.sasa.com.lk/sasa/index.php/add-member/article/new/index.php"
'go to web page listed inside quotes
IE.Visible = True

While IE.Busy
DoEvents 'wait until IE is done loading page.
Wend
IE.Document.All("jform[title]").Value = ThisWorkbook.Sheets("sheet2").Range("b2")
IE.Document.All("t3").Value = ThisWorkbook.Sheets("sheet2").Range("t2")
IE.Document.All("t14").Value = ThisWorkbook.Sheets("sheet2").Range("s2")
IE.Document.All("t46").Value = ThisWorkbook.Sheets("sheet2").Range("u2")
IE.Document.All("t48").Value = ThisWorkbook.Sheets("sheet2").Range("v2")
IE.Document.All("t4").Value = ThisWorkbook.Sheets("sheet2").Range("h2")
IE.Document.All("t6").Value = ThisWorkbook.Sheets("sheet2").Range("i2")
IE.Document.All("t7").Value = ThisWorkbook.Sheets("sheet2").Range("j2")
IE.Document.All("t8").Value = ThisWorkbook.Sheets("sheet2").Range("k2")
IE.Document.All("t9").Value = ThisWorkbook.Sheets("sheet2").Range("l2")
IE.Document.All("t11").Value = ThisWorkbook.Sheets("sheet2").Range("m2")
IE.Document.All("t12").Value = ThisWorkbook.Sheets("sheet2").Range("n2")
IE.Document.All("t11").Value = ThisWorkbook.Sheets("sheet2").Range("m2")
IE.Document.All("t13").Value = ThisWorkbook.Sheets("sheet2").Range("q2")
IE.Document.All("t22").Value = ThisWorkbook.Sheets("sheet2").Range("r2")
IE.Document.All("t17").Value = ThisWorkbook.Sheets("sheet2").Range("c2")
IE.Document.All("t18").Value = ThisWorkbook.Sheets("sheet2").Range("d2")
IE.Document.All("t19").Value = ThisWorkbook.Sheets("sheet2").Range("e2")
IE.Document.All("t20").Value = ThisWorkbook.Sheets("sheet2").Range("f2")
IE.Document.All("t21").Value = ThisWorkbook.Sheets("sheet2").Range("g2")
IE.Document.All("t23").Value = ThisWorkbook.Sheets("sheet2").Range("w2")
IE.Document.All("t26").Value = ThisWorkbook.Sheets("sheet2").Range("x2")
IE.Document.All("t24").Value = ThisWorkbook.Sheets("sheet2").Range("y2")
IE.Document.All("t25").Value = ThisWorkbook.Sheets("sheet2").Range("z2")

IE.Document.All("t27").Value = ThisWorkbook.Sheets("sheet2").Range("aa2")
IE.Document.All("t28").Value = ThisWorkbook.Sheets("sheet2").Range("ab2")
IE.Document.All("t29").Value = ThisWorkbook.Sheets("sheet2").Range("ac2")
IE.Document.All("t30").Value = ThisWorkbook.Sheets("sheet2").Range("ad2")

IE.Document.All("t31").Value = ThisWorkbook.Sheets("sheet2").Range("ae2")
IE.Document.All("t32").Value = ThisWorkbook.Sheets("sheet2").Range("af2")
IE.Document.All("t33").Value = ThisWorkbook.Sheets("sheet2").Range("ag2")
IE.Document.All("t34").Value = ThisWorkbook.Sheets("sheet2").Range("ah2")

IE.Document.All("t35").Value = ThisWorkbook.Sheets("sheet2").Range("ai2")
IE.Document.All("t36").Value = ThisWorkbook.Sheets("sheet2").Range("aj2")
IE.Document.All("t37").Value = ThisWorkbook.Sheets("sheet2").Range("ak2")
IE.Document.All("t38").Value = ThisWorkbook.Sheets("sheet2").Range("al2")

IE.Document.All("t39").Value = ThisWorkbook.Sheets("sheet2").Range("am2")
IE.Document.All("t40").Value = ThisWorkbook.Sheets("sheet2").Range("an2")
IE.Document.All("t42").Value = ThisWorkbook.Sheets("sheet2").Range("ao2")
IE.Document.All("t41").Value = ThisWorkbook.Sheets("sheet2").Range("ap2")
 
Back
Top