Good afternoon all,
I'm looking to build a macro that will allow me to paste the contents of Column A in Sheet1 into a web URL entry box. The issue is that this has proven to be a little tricky to set up, as navigating to the specific input field on the website requires logging in and entering additional data for this field to appear. As such, I'd like to have the user navigate on their own to that point on the webpage, then run the macro and have the macro refer to that navigated page (IE works fine).
I need all the data in column A to be pasted into this field, one row at a time. Between each row being pasted in, I also need to simulate pressing the "Enter" key in order to send the data (this takes less than 2 seconds to do, after which point the field is cleared on the web page and ready to accept another entry). I've been playing around with the below macro:
Sub MoveItems()
Dim objIE As InternetExplorer
Dim y As Integer
For y = 1 To 4000
If Left(Sheets("Sheet1").Range("A" & y).Value, 1) = "G" Then
Sheets("Sheet1").Range("A" & y).Copy
objIE.document.getElementById("txtSerial").Value = ActiveCell.Value
objIE.document.getElementById("txtSerial").Paste
Application.SendKeys "~"
Application.Wait (Now + TimeValue("0:00:4"))
Else
y = 4001
End If
Next y
End Sub
The name of the entry field on the web page looks as below:
<INPUT onchange=AddToCartonList(); tabIndex=6 id=txtSerial title="Please Enter Serial" class=marg-inp style="WIDTH: 180px" maxLength=30 jQuery18306157905514084456="13">
Any help would be greatly appreciated!
I'm looking to build a macro that will allow me to paste the contents of Column A in Sheet1 into a web URL entry box. The issue is that this has proven to be a little tricky to set up, as navigating to the specific input field on the website requires logging in and entering additional data for this field to appear. As such, I'd like to have the user navigate on their own to that point on the webpage, then run the macro and have the macro refer to that navigated page (IE works fine).
I need all the data in column A to be pasted into this field, one row at a time. Between each row being pasted in, I also need to simulate pressing the "Enter" key in order to send the data (this takes less than 2 seconds to do, after which point the field is cleared on the web page and ready to accept another entry). I've been playing around with the below macro:
Sub MoveItems()
Dim objIE As InternetExplorer
Dim y As Integer
For y = 1 To 4000
If Left(Sheets("Sheet1").Range("A" & y).Value, 1) = "G" Then
Sheets("Sheet1").Range("A" & y).Copy
objIE.document.getElementById("txtSerial").Value = ActiveCell.Value
objIE.document.getElementById("txtSerial").Paste
Application.SendKeys "~"
Application.Wait (Now + TimeValue("0:00:4"))
Else
y = 4001
End If
Next y
End Sub
The name of the entry field on the web page looks as below:
<INPUT onchange=AddToCartonList(); tabIndex=6 id=txtSerial title="Please Enter Serial" class=marg-inp style="WIDTH: 180px" maxLength=30 jQuery18306157905514084456="13">
Any help would be greatly appreciated!