Hi Guys,
I have been trying to figure this out and looking everywhere on the web but I am stuck. I have no experience with VBA except for 2 hours on the web and figured out how to post data onto a website that I am doing.
My data is in A - E and 10 or 50 rows, it doesn't matter. I cant figure out how to loop this until the end of the row? It works for the row itself but I need it to repeat for the next 10, 20, or 50 row items.
Can someone point me in the right direction or let me know what the code is to loop? The bold is highlighted, so it does everything in E2 and fills it out for A2-C2. Then it needs to start at E3 and keep repeating.
Sub Fill1()
Dim IE As Object
Dim doc As HTMLDocument
Dim filename As String
Set IE = CreateObject("InternetExplorer.Application")
'Loop here for each value and keep repeating until the last row.
IE.Visible = True
IE.navigate Sheets("Export").Range("E2").Value
Do While IE.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
Set doc = IE.document
doc.getElementById("tbLocalTitle").Value = ThisWorkbook.Sheets("Export").Range("A2").Value
doc.getElementById("txtKeywords").Value = ThisWorkbook.Sheets("Export").Range("B2").Value
doc.getElementById("txtLoDescription").Value = ThisWorkbook.Sheets("Export").Range("C2").Value
doc.getElementById("LanguageControl_LangCB_Arrow").Click
doc.getElementById("LanguageControl_LangCB_i3_Label1").Click
doc.getElementById("LanguageControl_LangCB_i8_Label1").Click
doc.getElementById("SubmitButton").Click
Application.Wait DateAdd("s", 2, Now)
IE.Quit
'stop loop and start again
End Sub
Thanks in advance
I have been trying to figure this out and looking everywhere on the web but I am stuck. I have no experience with VBA except for 2 hours on the web and figured out how to post data onto a website that I am doing.
My data is in A - E and 10 or 50 rows, it doesn't matter. I cant figure out how to loop this until the end of the row? It works for the row itself but I need it to repeat for the next 10, 20, or 50 row items.
Can someone point me in the right direction or let me know what the code is to loop? The bold is highlighted, so it does everything in E2 and fills it out for A2-C2. Then it needs to start at E3 and keep repeating.
Sub Fill1()
Dim IE As Object
Dim doc As HTMLDocument
Dim filename As String
Set IE = CreateObject("InternetExplorer.Application")
'Loop here for each value and keep repeating until the last row.
IE.Visible = True
IE.navigate Sheets("Export").Range("E2").Value
Do While IE.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
Set doc = IE.document
doc.getElementById("tbLocalTitle").Value = ThisWorkbook.Sheets("Export").Range("A2").Value
doc.getElementById("txtKeywords").Value = ThisWorkbook.Sheets("Export").Range("B2").Value
doc.getElementById("txtLoDescription").Value = ThisWorkbook.Sheets("Export").Range("C2").Value
doc.getElementById("LanguageControl_LangCB_Arrow").Click
doc.getElementById("LanguageControl_LangCB_i3_Label1").Click
doc.getElementById("LanguageControl_LangCB_i8_Label1").Click
doc.getElementById("SubmitButton").Click
Application.Wait DateAdd("s", 2, Now)
IE.Quit
'stop loop and start again
End Sub
Thanks in advance