Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

send "CTRL + F" command from excel to Internet

Status
Not open for further replies.

bartrein

Programmer
Sep 22, 2008
49
EU
Is there a simple way of doing this?
I want to find a particular word on the page of the website and highlight it just as if i was using ctrl+f within internet explorer. I would like to send this command from excel though - is this possible?

thanks

Sub FindMyText()

Dim appIE As InternetExplorer
Dim sURL As String
dim sText as string

sText="MCAB"

Set appIE = New InternetExplorer

sURL = "
With appIE
.Visible = True
.Navigate sURL

End With


SendKeys "^F" 'followed by sText and Enter


End Sub
 
Hi All

I have asked that question some time ago.
This time i have done my homework and got a bit closer but still no joy.

I am trying to open internet from excel and send ctrl+F command from my vba code.

I know now that do to this i need to activate my internet window - which i can ado by using "appactivate" command.

The last step is to call sendkeys ctrl+f command but this does not seem to work. I have tried to send different commands (e.g. {F1} did work) and they seen to be ok.

Does anyone now how to send this ctrl+F command?
Is SendKeys "^F" the right syntax?

below my code:
------------------------------------------------------
Sub FindMyText()

Dim appIE As InternetExplorer
Dim sURL As String
dim sText as string

sText="MCAB"

Set appIE = New InternetExplorer

sURL = "
With appIE
.Visible = True
.Navigate sURL

End With


AppActivate objIE.LocationName & " - Microsoft Internet Explorer"

SendKeys "^F" 'doesn't work

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top