Hello, I am trying to make a macro that will search a specific website's Search-Box
So far my macro works ok for searching Google but will not work for FinViz. Any Help is Greatly Appreciated!
Current Macro:
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
UserSearch = Range("H8")
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "http://finviz.com/"
Application.StatusBar = "Submitting"
' Wait while IE loading...
While IE.Busy
DoEvents
Wend
' **********************************************************************
delay 1
IE.Document.getElementById("lst-ib").Value = UserSearch
delay 1
SendKeys "{Enter}"
'**********************************************************************
Application.StatusBar = "Submitted"
'IE.Quit
Set IE = Nothing
Application.ScreenUpdating = True
End Sub
Private Sub delay(seconds As Long)
Dim endTime As Date
endTime = DateAdd("s", seconds, Now())
Do While Now() < endTime
DoEvents
Loop
End Sub
Bookmarks