ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Search Google from Textbox (https://www.excelbanter.com/excel-programming/342675-search-google-textbox.html)

John[_88_]

Search Google from Textbox
 
Hi there,

I've got a user form which I'm using to check against a list of names. What
I'd like to do is to assign a (Google) search to a command button, with the
search words based on the text in a textbox.

Can anyone point me in the right direction?

(The button just needs to activate Internet Explorer with Google and the
search results.)

Thanks

John



Tom Ogilvy

Search Google from Textbox
 
See Ron de Bruin's site:
http://www.rondebruin.nl/Google.htm

--
Regards,
Tom Ogilvy


"John" wrote in message
...
Hi there,

I've got a user form which I'm using to check against a list of names.

What
I'd like to do is to assign a (Google) search to a command button, with

the
search words based on the text in a textbox.

Can anyone point me in the right direction?

(The button just needs to activate Internet Explorer with Google and the
search results.)

Thanks

John





John[_88_]

Search Google from Textbox
 
Hi Tom,

Thanks for this. Looks very interesting, but I was hoping to use it on my
own command button so that the user does have to type in the text that's
already there.

Any clues?

Thanks again

John
"Tom Ogilvy" wrote in message
...
See Ron de Bruin's site:
http://www.rondebruin.nl/Google.htm

--
Regards,
Tom Ogilvy


"John" wrote in message
...
Hi there,

I've got a user form which I'm using to check against a list of names.

What
I'd like to do is to assign a (Google) search to a command button, with

the
search words based on the text in a textbox.

Can anyone point me in the right direction?

(The button just needs to activate Internet Explorer with Google and the
search results.)

Thanks

John







Harald Staff

Search Google from Textbox
 
Hi John

Private Sub CommandButton1_Click()
ActiveWorkbook.FollowHyperlink _
"http://www.google.com/search?hl=en&q=" & _
Replace$(Me.TextBox1.Text, " ", "+")
End Sub

Refine this coding by scrutinizing your manual Google searches' returning
url's, using quotes, domain restricted searches, ...

HTH. Best wishes Harald

"John" skrev i melding
...
Hi there,

I've got a user form which I'm using to check against a list of names.

What
I'd like to do is to assign a (Google) search to a command button, with

the
search words based on the text in a textbox.

Can anyone point me in the right direction?

(The button just needs to activate Internet Explorer with Google and the
search results.)

Thanks

John





Tom Ogilvy

Search Google from Textbox
 


Send him an email and ask for some sample code.

--
Regards,
Tom Ogilvy


"John" wrote in message
...
Hi Tom,

Thanks for this. Looks very interesting, but I was hoping to use it on my
own command button so that the user does have to type in the text that's
already there.

Any clues?

Thanks again

John
"Tom Ogilvy" wrote in message
...
See Ron de Bruin's site:
http://www.rondebruin.nl/Google.htm

--
Regards,
Tom Ogilvy


"John" wrote in message
...
Hi there,

I've got a user form which I'm using to check against a list of names.

What
I'd like to do is to assign a (Google) search to a command button, with

the
search words based on the text in a textbox.

Can anyone point me in the right direction?

(The button just needs to activate Internet Explorer with Google and

the
search results.)

Thanks

John









John[_88_]

Search Google from Textbox
 
Great. Thanks Harald, this works perfectly.

Thanks also Tom for Ron's email.

Best regards

John
"Harald Staff" wrote in message
...
Hi John

Private Sub CommandButton1_Click()
ActiveWorkbook.FollowHyperlink _
"http://www.google.com/search?hl=en&q=" & _
Replace$(Me.TextBox1.Text, " ", "+")
End Sub

Refine this coding by scrutinizing your manual Google searches' returning
url's, using quotes, domain restricted searches, ...

HTH. Best wishes Harald

"John" skrev i melding
...
Hi there,

I've got a user form which I'm using to check against a list of names.

What
I'd like to do is to assign a (Google) search to a command button, with

the
search words based on the text in a textbox.

Can anyone point me in the right direction?

(The button just needs to activate Internet Explorer with Google and the
search results.)

Thanks

John







John[_88_]

Search Google from Textbox
 
....and for anyone who's interested the following includes some of the Google
converted symbols:

Private Sub cmdGoogle_Click()
Dim sSearchText As String
'Set search string
sSearchText = Me.lstBox1.Text
'Replace double quotes with Google equivilent
sSearchText = Replace$(sSearchText, Chr(34), "%22")
'Replace single quotes with Google equivilent
sSearchText = Replace$(sSearchText, Chr(39), "%27")
'Replace left bracket with Google equivilent
sSearchText = Replace$(sSearchText, Chr(40), "%28")
'Replace right bracket with Google equivilent
sSearchText = Replace$(sSearchText, Chr(41), "%29")
'Replace spaces with Google equivilent
sSearchText = Replace$(sSearchText, " ", "+")
ActiveWorkbook.FollowHyperlink _
"http://www.google.co.uk/search?hl=en&q=" & _
sSearchText
End Sub

Thanks again Harald and Tom.

"John" wrote in message
...
Great. Thanks Harald, this works perfectly.

Thanks also Tom for Ron's email.

Best regards

John
"Harald Staff" wrote in message
...
Hi John

Private Sub CommandButton1_Click()
ActiveWorkbook.FollowHyperlink _
"http://www.google.com/search?hl=en&q=" & _
Replace$(Me.TextBox1.Text, " ", "+")
End Sub

Refine this coding by scrutinizing your manual Google searches' returning
url's, using quotes, domain restricted searches, ...

HTH. Best wishes Harald

"John" skrev i melding
...
Hi there,

I've got a user form which I'm using to check against a list of names.

What
I'd like to do is to assign a (Google) search to a command button, with

the
search words based on the text in a textbox.

Can anyone point me in the right direction?

(The button just needs to activate Internet Explorer with Google and the
search results.)

Thanks

John










All times are GMT +1. The time now is 01:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com