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!

Using a CELL value to create a hyperlink 1

Status
Not open for further replies.

Wray69

Technical User
Oct 1, 2002
299
US
I need to use a value in a CELL to create a hyperlink. So for example If I had TEST in my cell I would like to click a button and go to
This is what I have so far;
Private Sub CommandButton1_Click()
ActiveWorkbook.FollowHyperlink Address:=" _
NewWindow:=True

End Sub

I just cant figure out how to grab the cell value andd put it into the command.

Regards,

Wray
 
I get a Compile error when I try that...

Wray
 
I posted without the semicolon and somehow it's putting it in the post, so just remove it.
 
Well I take out the semicolon and I get an automation error...
 
Does this work, again without the semicolon.
ActiveWorkbook.FollowHyperlink " True
And if so does the value &quot; and the value in cell (1, 1) create a valid link. For example if cell a1 contained test then the command would try to open <- which is not valid. In this case you would need to handle the error.
 
Here is what I have right now;

ActiveWorkbook.FollowHyperlink Address:=&quot; & Cells(16, 2), _
NewWindow:=False
And I get the error Cann not download the information you requested

If I went to the address by typing it in it is a valid address.

Wray
 
Try this
dim strAddress as string
straddress = &quot; & Cells(16, 2)
msgbox strAddress
ActiveWorkbook.FollowHyperlink straddress, False

You should see a msgbox pop up with the exact location that is about to be browsed to. My guess is that you probably need to change &quot; to &quot;
 
I get the Msgbox with and then I get a Runtime Error '5' Invalid Procedure call or argument. So it is linking the address together correctly.

Wray
 
Cool that did it.... Thanks for all the help.

Cheers,

Wray
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top