Hi
Is there a way to loop this? The only thing changing is the range and only the letters change alphabetically.
IE.document.All("itemCodeTextField").Select
IE.document.All("itemCodeTextField").Value = ThisWorkbook.Sheets("Inventory Outlook").Range("f4")
IE.document.All("quantityTextField").Select
IE.document.All("quantityTextField").Value = ThisWorkbook.Sheets("Order Sheet").Range("g17")
IE.document.All("quickOrderSubmitButton").Click
While IE.busy
DoEvents
Wend
Call WaitFor(0.5)
'03rd iteration
IE.document.All("itemCodeTextField").Select
IE.document.All("itemCodeTextField").Value = ThisWorkbook.Sheets("Inventory Outlook").Range("h4")
IE.document.All("quantityTextField").Select
IE.document.All("quantityTextField").Value = ThisWorkbook.Sheets("Order Sheet").Range("i17")
IE.document.All("quickOrderSubmitButton").Click
While IE.busy
DoEvents
Wend
Call WaitFor(0.5)
'04th iteration
IE.document.All("itemCodeTextField").Select
IE.document.All("itemCodeTextField").Value = ThisWorkbook.Sheets("Inventory Outlook").Range("j4")
IE.document.All("quantityTextField").Select
IE.document.All("quantityTextField").Value = ThisWorkbook.Sheets("Order Sheet").Range("k17")
IE.document.All("quickOrderSubmitButton").Click
While IE.busy
DoEvents
Wend
Call WaitFor(0.5)
'05th iteration
IE.document.All("itemCodeTextField").Select
IE.document.All("itemCodeTextField").Value = ThisWorkbook.Sheets("Inventory Outlook").Range("l4")
IE.document.All("quantityTextField").Select
IE.document.All("quantityTextField").Value = ThisWorkbook.Sheets("Order Sheet").Range("m17")
IE.document.All("quickOrderSubmitButton").Click
While IE.busy
DoEvents
Wend
Call WaitFor(0.5)
'06th iteration
IE.document.All("itemCodeTextField").Select
IE.document.All("itemCodeTextField").Value = ThisWorkbook.Sheets("Inventory Outlook").Range("n4")
IE.document.All("quantityTextField").Select
IE.document.All("quantityTextField").Value = ThisWorkbook.Sheets("Order Sheet").Range("o17")
IE.document.All("quickOrderSubmitButton").Click
While IE.busy
DoEvents
Wend
Call WaitFor(0.5)
'07th iteration
IE.document.All("itemCodeTextField").Select
IE.document.All("itemCodeTextField").Value = ThisWorkbook.Sheets("Inventory Outlook").Range("p4")
IE.document.All("quantityTextField").Select
IE.document.All("quantityTextField").Value = ThisWorkbook.Sheets("Order Sheet").Range("q17")
IE.document.All("quickOrderSubmitButton").Click
While IE.busy
DoEvents
Wend
Call WaitFor(0.5)
'08th iteration
IE.document.All("itemCodeTextField").Select
IE.document.All("itemCodeTextField").Value = ThisWorkbook.Sheets("Inventory Outlook").Range("r4")
IE.document.All("quantityTextField").Select
IE.document.All("quantityTextField").Value = ThisWorkbook.Sheets("Order Sheet").Range("s17")
IE.document.All("quickOrderSubmitButton").Click
While IE.busy
DoEvents
Wend
Call WaitFor(0.5)
'09th iteration
IE.document.All("itemCodeTextField").Select
IE.document.All("itemCodeTextField").Value = ThisWorkbook.Sheets("Inventory Outlook").Range("t4")
IE.document.All("quantityTextField").Select
IE.document.All("quantityTextField").Value = ThisWorkbook.Sheets("Order Sheet").Range("u17")
IE.document.All("quickOrderSubmitButton").Click
While IE.busy
DoEvents
Wend
Call WaitFor(0.5)
'10th iteration
IE.document.All("itemCodeTextField").Select
IE.document.All("itemCodeTextField").Value = ThisWorkbook.Sheets("Inventory Outlook").Range("v4")
IE.document.All("quantityTextField").Select
IE.document.All("quantityTextField").Value = ThisWorkbook.Sheets("Order Sheet").Range("w17")
IE.document.All("quickOrderSubmitButton").Click
While IE.busy
DoEvents
Wend
Call WaitFor(0.5)
'11th iteration
IE.document.All("itemCodeTextField").Select
IE.document.All("itemCodeTextField").Value = ThisWorkbook.Sheets("Inventory Outlook").Range("x4")
IE.document.All("quantityTextField").Select
IE.document.All("quantityTextField").Value = ThisWorkbook.Sheets("Order Sheet").Range("y17")
IE.document.All("quickOrderSubmitButton").Click
While IE.busy
DoEvents
Wend
Call WaitFor(0.5)
'12th iteration
IE.document.All("itemCodeTextField").Select
IE.document.All("itemCodeTextField").Value = ThisWorkbook.Sheets("Inventory Outlook").Range("z4")
IE.document.All("quantityTextField").Select
IE.document.All("quantityTextField").Value = ThisWorkbook.Sheets("Order Sheet").Range("aa17")
IE.document.All("quickOrderSubmitButton").Click
While IE.busy
DoEvents
Wend
Call WaitFor(0.5)
'13th iteration
IE.document.All("itemCodeTextField").Select
IE.document.All("itemCodeTextField").Value = ThisWorkbook.Sheets("Inventory Outlook").Range("ab4")
IE.document.All("quantityTextField").Select
IE.document.All("quantityTextField").Value = ThisWorkbook.Sheets("Order Sheet").Range("ac17")
IE.document.All("quickOrderSubmitButton").Click
While IE.busy
DoEvents
Wend
Call WaitFor(0.5)
'14th iteration
IE.document.All("itemCodeTextField").Select
IE.document.All("itemCodeTextField").Value = ThisWorkbook.Sheets("Inventory Outlook").Range("ad4")
IE.document.All("quantityTextField").Select
IE.document.All("quantityTextField").Value = ThisWorkbook.Sheets("Order Sheet").Range("ae17")
IE.document.All("quickOrderSubmitButton").Click
While IE.busy
DoEvents
Wend
Call WaitFor(0.5)
'15th iteration
IE.document.All("itemCodeTextField").Select
IE.document.All("itemCodeTextField").Value = ThisWorkbook.Sheets("Inventory Outlook").Range("af4")
IE.document.All("quantityTextField").Select
IE.document.All("quantityTextField").Value = ThisWorkbook.Sheets("Order Sheet").Range("ag17")
IE.document.All("quickOrderSubmitButton").Click
While IE.busy
DoEvents
Wend
Call WaitFor(0.5)
'16th iteration
IE.document.All("itemCodeTextField").Select
IE.document.All("itemCodeTextField").Value = ThisWorkbook.Sheets("Inventory Outlook").Range("ah4")
IE.document.All("quantityTextField").Select
IE.document.All("quantityTextField").Value = ThisWorkbook.Sheets("Order Sheet").Range("ai17")
IE.document.All("quickOrderSubmitButton").Click
While IE.busy
DoEvents
Wend
Call WaitFor(0.5)
'17th iteration
IE.document.All("itemCodeTextField").Select
IE.document.All("itemCodeTextField").Value = ThisWorkbook.Sheets("Inventory Outlook").Range("aj4")
IE.document.All("quantityTextField").Select
IE.document.All("quantityTextField").Value = ThisWorkbook.Sheets("Order Sheet").Range("ak17")
IE.document.All("quickOrderSubmitButton").Click
While IE.busy
DoEvents
Wend
Call WaitFor(0.5)
'18th iteration
IE.document.All("itemCodeTextField").Select
IE.document.All("itemCodeTextField").Value = ThisWorkbook.Sheets("Inventory Outlook").Range("al4")
IE.document.All("quantityTextField").Select
IE.document.All("quantityTextField").Value = ThisWorkbook.Sheets("Order Sheet").Range("am17")
IE.document.All("quickOrderSubmitButton").Click
While IE.busy
DoEvents
Wend
Call WaitFor(0.5)
'19th iteration
IE.document.All("itemCodeTextField").Select
IE.document.All("itemCodeTextField").Value = ThisWorkbook.Sheets("Inventory Outlook").Range("an4")
IE.document.All("quantityTextField").Select
IE.document.All("quantityTextField").Value = ThisWorkbook.Sheets("Order Sheet").Range("ao17")
IE.document.All("quickOrderSubmitButton").Click
While IE.busy
DoEvents
Wend
Call WaitFor(0.5)
'20th iteration
IE.document.All("itemCodeTextField").Select
IE.document.All("itemCodeTextField").Value = ThisWorkbook.Sheets("Inventory Outlook").Range("ap4")
IE.document.All("quantityTextField").Select
IE.document.All("quantityTextField").Value = ThisWorkbook.Sheets("Order Sheet").Range("aq17")
IE.document.All("quickOrderSubmitButton").Click
While IE.busy
DoEvents
Wend
Call WaitFor(0.5)
'21st iteration
IE.document.All("itemCodeTextField").Select
IE.document.All("itemCodeTextField").Value = ThisWorkbook.Sheets("Inventory Outlook").Range("ar4")
IE.document.All("quantityTextField").Select
IE.document.All("quantityTextField").Value = ThisWorkbook.Sheets("Order Sheet").Range("as17")
IE.document.All("quickOrderSubmitButton").Click
While IE.busy
DoEvents
Wend
Call WaitFor(0.5)
'22nd iteration
IE.document.All("itemCodeTextField").Select
IE.document.All("itemCodeTextField").Value = ThisWorkbook.Sheets("Inventory Outlook").Range("at4")
IE.document.All("quantityTextField").Select
IE.document.All("quantityTextField").Value = ThisWorkbook.Sheets("Order Sheet").Range("au17")
IE.document.All("quickOrderSubmitButton").Click
While IE.busy
DoEvents
Wend
Call WaitFor(0.5)
'23rd iteration
IE.document.All("itemCodeTextField").Select
IE.document.All("itemCodeTextField").Value = ThisWorkbook.Sheets("Inventory Outlook").Range("av4")
IE.document.All("quantityTextField").Select
IE.document.All("quantityTextField").Value = ThisWorkbook.Sheets("Order Sheet").Range("aw17")
IE.document.All("quickOrderSubmitButton").Click
While IE.busy
DoEvents
Wend
Call WaitFor(0.5)
'24th iteration
IE.document.All("itemCodeTextField").Select
IE.document.All("itemCodeTextField").Value = ThisWorkbook.Sheets("Inventory Outlook").Range("ax4")
IE.document.All("quantityTextField").Select
IE.document.All("quantityTextField").Value = ThisWorkbook.Sheets("Order Sheet").Range("ay17")
IE.document.All("quickOrderSubmitButton").Click
While IE.busy
DoEvents
Wend
Call WaitFor(0.5)
'25th iteration
IE.document.All("itemCodeTextField").Select
IE.document.All("itemCodeTextField").Value = ThisWorkbook.Sheets("Inventory Outlook").Range("az4")
IE.document.All("quantityTextField").Select
IE.document.All("quantityTextField").Value = ThisWorkbook.Sheets("Order Sheet").Range("ba17")
IE.document.All("quickOrderSubmitButton").Click
While IE.busy
DoEvents
Wend
Call WaitFor(0.5)
Thanks
Bookmarks