vikneshwar
New Member
- Joined
- Sep 10, 2012
- Messages
- 9
I Have a requirement to fill a web form using VBA. In a input data sheet Column F,G,H has few cell are blank.
I want to skip those blank cells and move to next statement without showing any error.
I have mentioned the VBA SCRIPT which I have created.
If someone help me to fix this i will feel very glad.
From the following I want to skip the blank cells and go for next statement. Column ( F, G, H)
I want to skip those blank cells and move to next statement without showing any error.
I have mentioned the VBA SCRIPT which I have created.
If someone help me to fix this i will feel very glad.
From the following I want to skip the blank cells and go for next statement. Column ( F, G, H)
VBA Code:
Sub copy_project_loop()
Dim IE As Object
Dim Doc As HTMLDocument
Set IE = CreateObject("InternetExplorer.Application")
Dim SHELL_OBJECT
SHELL_OBJECT = "WScript.Shell"
Set objShell = CreateObject(SHELL_OBJECT)
IE.Visible = True
IE.navigate "[URL='https://www.*******?CSTK=Y']Login[/URL]"
Do While IE.readyState <> READYSTATE_COMPLETE Or IE.Busy: DoEvents: Loop
Set Doc = IE.document
' Set numrows = number of rows of data.
NumRows = Range("A1", Range("A1").End(xlDown)).Rows.Count
' Establish "For" loop to loop "numrows" number of times.
For intRow = 2 To NumRows
Doc.getElementById("txtTimeStudyNbr").Value = ThisWorkbook.Sheets("data").Range("A" & intRow).Value
Doc.getElementById("Search").Click
Do While IE.readyState <> READYSTATE_COMPLETE Or IE.Busy: DoEvents: Loop
Doc.getElementById("lstQualifierTypes").Value = ThisWorkbook.Sheets("data").Range("E1").Value
Doc.getElementById("Search").Click
Do While IE.readyState <> READYSTATE_COMPLETE Or IE.Busy: DoEvents: Loop
Doc.getElementById("lstQualifiers").Value = [COLOR=rgb(85, 57, 130)][B]ThisWorkbook.Sheets("data").Range("E" & intRow).Value[/B][/COLOR]
Doc.getElementById("ADD").Click
Do While IE.readyState <> READYSTATE_COMPLETE Or IE.Busy: DoEvents: Loop
Doc.getElementById("lstQualifierTypes").Value = ThisWorkbook.Sheets("data").Range("F1").Value
Doc.getElementById("Search").Click
Do While IE.readyState <> READYSTATE_COMPLETE Or IE.Busy: DoEvents: Loop
Doc.getElementById("lstQualifiers").Value = [COLOR=rgb(85, 57, 130)][B]ThisWorkbook.Sheets("data").Range("F" & intRow).Value[/B][/COLOR]
Doc.getElementById("ADD").Click
Do While IE.readyState <> READYSTATE_COMPLETE Or IE.Busy: DoEvents: Loop
Doc.getElementById("lstQualifierTypes").Value = ThisWorkbook.Sheets("data").Range("G1").Value
Doc.getElementById("Search").Click
Do While IE.readyState <> READYSTATE_COMPLETE Or IE.Busy: DoEvents: Loop
Doc.getElementById("lstQualifiers").Value = [B][COLOR=rgb(85, 57, 130)]ThisWorkbook.Sheets("data").Range("G" & intRow).Value[/COLOR][/B]
Doc.getElementById("ADD").Click
Do While IE.readyState <> READYSTATE_COMPLETE Or IE.Busy: DoEvents: Loop
Doc.getElementById("lstQualifierTypes").Value = ThisWorkbook.Sheets("data").Range("H1").Value
Doc.getElementById("Search").Click
Do While IE.readyState <> READYSTATE_COMPLETE Or IE.Busy: DoEvents: Loop
Doc.getElementById("lstQualifiers").Value = [COLOR=rgb(85, 57, 130)][B]ThisWorkbook.Sheets("data").Range("H" & intRow).Value[/B][/COLOR]
Doc.getElementById("ADD").Click
Next
End Sub
Last edited by a moderator: