Art,
I use the below as a track trace prog at work. This should do what you
want with a few changes. First you will want to create a command button and
place it on your worksheet. Once the command button is in the sheet just
double click the button. That will open the Visual Basic Editor with a
private sub called CommandButton1_Click(). Between Private Sub Line and End
Sub put in openURL. Now go to insert on the tool bar and select Module.
This will open a new window in the VBE probably called module 1. The name of
this module doesn't really matter. Copy the code below and paste it into
this new module. Your web browser is going to mess up the Declare Function.
Just make sure that everything between Public Declare down to As Long is on
the first line of the module.
Post back if this doesn't do what you are wanting.
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA"
(ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String,
ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As
Long) As Long
Public Sub openURL()
Dim value As String
Dim pos As Integer
value = Range("A1").value
value = Application.Substitute(value, " ", "+")
Debug.Print value
ShellExecute 0, vbNullString, "
http://www.google.com/search?hl=en&q=" & value,
vbNullString, vbNullString, vbNormalFocus
End Sub
now it tells me the problem is "Worksheet". I tried putting a ' before
worksheet as well, but then other problems come up. Can you please help me
clear out this problem, or tell me any easy way to be able to make a web
query to search fot the zip code that will be in cell A1?
The words Submit button should be commented. Web browsers don't really allow
you to copy info the way it was typed. Just put a ' before the words submit
[quoted text clipped - 9 lines]
Next copy/paste the code from above into the module between Sub and
End Sub. Then, just run the macro...Ron