Re: VBA Hyperlink Question

  • Thread starter Thread starter Tom Ogilvy
  • Start date Start date
T

Tom Ogilvy

Change
SubAddress:=ws.Name & "!A1

to

SubAddress:="'" & wsName & "'!A1"

Note that I have put --> doublequote singlequote doublequote & <-- before
swName

and in "!A1" I have added a singlequote after the first doublequote.

Regards,
Tom Ogilvy
 
Thanks, Tom.
Did you get a chance to test this?
I can't get it to work.
Appreciate your feedback.
 
Table of Contents

Sheet5
Master
Sheet 3
Sheet one
Master (2)
Master (3)


is an example and all the hyperlinks worked.
 
Thanks, Tom.
Worked perfectly.


Tom Ogilvy said:
Table of Contents

Sheet5
Master
Sheet 3
Sheet one
Master (2)
Master (3)


is an example and all the hyperlinks worked.

--
Regards,
Tom Ogilvy


test so
 
Great solution, Tom - my macro runs now! Been googling my ass off for a solution. Here's my source code if anyone else has trouble:

Sub add_links()
Dim nameRange As Range
Dim thisCell As Range
Set nameRange = Range(Cells(2, 1), Cells(2, 1).End(xlDown)).Cells

For Each cl In nameRange
Set thisCell = cl

ActiveSheet.Hyperlinks.Add _
Anchor:=thisCell, _
Address:="", _
SubAddress:="" & cl.Value & "!A1", _
TextToDisplay:=cl.Value
Next cl

End Sub
 
Back
Top