Hey,

I'm trying to withdraw contribution money from the members of a sports ascociation of which i am the treasurer, but filling in a SEPA withdrawal form online 150 times seems like a bit of a waste of time. I have no experience with VBA whatsoever but I found a few module parts from different websites and managed to make my code work for filling in individual forms. However, right now if I run the script it will only fill in the first row, (as I specified it in my code) but I need it to do just the same action, but for a different row each time. So instead of only filling in the data from cells a2,b2,c2 etc. I need it to repeat but then using a3,b3,c3 etc. and then a4,b4,c4 etc. until the end of my data.


This is what I have so far.

Sub FillInternetForm()
Dim IE As Object
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 "https://bankieren.triodos.nl/ib-seam/pages/accountmanagement/direct-debit/sepa-direct-debit-nl.seam"
'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("paymentForm:j_idt263:zamount:amount_fraction").Value = ThisWorkbook.Sheets("sheet1").Range("a2")

Application.Wait Now + TimeValue("00:00:01")

IE.Document.ALL("paymentForm:j_idt263:zamount:amount_integer").Value = ThisWorkbook.Sheets("sheet1").Range("a2")



IE.Document.ALL("paymentForm:j_idt301:j_idt302:diban:ziban:iban").Value = ThisWorkbook.Sheets("sheet1").Range("b2")



IE.Document.ALL("paymentForm:j_idt327:dname:zname:name").Value = ThisWorkbook.Sheets("sheet1").Range("c2")

IE.Document.ALL("paymentForm:j_idt363:dpaymentForm:zpaymentForm:paymentForm").Value = ThisWorkbook.Sheets("sheet1").Range("d2")



IE.Document.ALL("paymentForm:j_idt374:dpaymentForm:zpaymentForm:paymentFormInputDate").Value = ThisWorkbook.Sheets("sheet1").Range("e2")

Application.Wait Now + TimeValue("00:00:01")

IE.Document.ALL("paymentForm:j_idt403:j_idt404:ddescr_free:zdescr_free:descr_free").Value = ThisWorkbook.Sheets("sheet1").Range("f2")

Application.Wait Now + TimeValue("00:00:01")

IE.Document.ALL("paymentForm:j_idt417:zsequenceType:sequenceType").selectedindex = 2


Application.Wait Now + TimeValue("00:00:01")

IE.Document.ALL("paymentForm:j_idt431:j_idt432:drequestedCollectionDate:zrequestedCollectionDate:requestedCollectionDateInputDate").Value = ThisWorkbook.Sheets("sheet1").Range("g2")

Application.Wait Now + TimeValue("00:00:01")

IE.Document.ALL("paymentForm:savePaymentAndCreateNewLink").Click
End Sub
Any help, ideas?
Thank you!