clif
05-09-2017, 09:38 PM
Dim wb As Workbook
Dim ws As Worksheet
Dim a As Integer
Dim ie As Object
Set wb = ThisWorkbook
Set ws = wb.Sheets("main")
For a = 2 To 2
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.navigate ws.Cells(1, 2)
While ie.Busy: DoEvents
Wend
Do
Loop Until Not (ie.Busy)
ie.document.all(ws.Cells(2, 2).Value).Value = ws.Cells(a, 1)
ie.document.all(ws.Cells(3, 2).Value).Click
ie.document.all(ws.Cells(4, 2).Value).Click
From above code, will redirect to another webpage.
how to continuse search in the current webpage?
Thisdocument.all(ws.Cells(5, 2).Value).Click
While ie.Busy: DoEvents
Wend
Do
Loop Until Not (ie.Busy)
'ie.Quit
'Set ie = Nothing
Next a
'clean up
'Set ie = Nothing
'Set ws = Nothing
'Set wb = Nothing
'wrdDoc.Close
'wrdApp.Quit
End Sub
Thanks!
Dim ws As Worksheet
Dim a As Integer
Dim ie As Object
Set wb = ThisWorkbook
Set ws = wb.Sheets("main")
For a = 2 To 2
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.navigate ws.Cells(1, 2)
While ie.Busy: DoEvents
Wend
Do
Loop Until Not (ie.Busy)
ie.document.all(ws.Cells(2, 2).Value).Value = ws.Cells(a, 1)
ie.document.all(ws.Cells(3, 2).Value).Click
ie.document.all(ws.Cells(4, 2).Value).Click
From above code, will redirect to another webpage.
how to continuse search in the current webpage?
Thisdocument.all(ws.Cells(5, 2).Value).Click
While ie.Busy: DoEvents
Wend
Do
Loop Until Not (ie.Busy)
'ie.Quit
'Set ie = Nothing
Next a
'clean up
'Set ie = Nothing
'Set ws = Nothing
'Set wb = Nothing
'wrdDoc.Close
'wrdApp.Quit
End Sub
Thanks!