MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Hyperlink Macro Help!!


Posted by Rich Baxter on November 12, 2001 9:44 AM

Hello
I am trying to create a macro that will move the cursor to the next cell to the right and make it into a hyperlink like this:
http://135.64.159.53/dispPhysPortDetail/Port15.1

That's easy of course, but each time I run the macro, I want the last figure on the link to jump up by 1, so the next one would read:
http://135.64.159.53/dispPhysPortDetail/Port15.2

The cells themselves just read the last figure, so the first is "1", second is "2" etc....
Any help would be greatly appreciated!

Thanks
Rich


Posted by faster on November 12, 2001 10:06 AM

Sub LinkCell()
'if H1 is not blank change code to a blank cell
'just use a blank cell to hold the value of the next "jump"
Range("H1") = Range("H1") + 1

ActiveSheet.Hyperlinks.Add Anchor:=Selection.Offset(0, 1), _
Address:="http://135.64.159.53/dispPhysPortDetail/Port15." & Range("h1"), _
TextToDisplay:="Link"
End Sub