Hi All-
I modified a piece of code to hyperlink each cell to a particular sheet. Now the code works fine if the cell (name of the sheet) does not have any space. For example, if I have a sheet called "Sheet1" then it would link, but if I have a sheet called "Sheet1 Updated", the code does not link.
Any help would be great. Below is the code.
Dim nameRange As Range
Dim thisCell As Range
Set nameRange = Selection
For Each cl In nameRange
Set thisCell = cl
ActiveSheet.Hyperlinks.Add _
Anchor:=ActiveCell.Offset(0, -5), _
Address:="", _
SubAddress:="" & cl.Value & "!A1", _
TextToDisplay:=ActiveCell.Offset(0, -5).Value
Next cl
Thanks,
Bablu
I modified a piece of code to hyperlink each cell to a particular sheet. Now the code works fine if the cell (name of the sheet) does not have any space. For example, if I have a sheet called "Sheet1" then it would link, but if I have a sheet called "Sheet1 Updated", the code does not link.
Any help would be great. Below is the code.
Dim nameRange As Range
Dim thisCell As Range
Set nameRange = Selection
For Each cl In nameRange
Set thisCell = cl
ActiveSheet.Hyperlinks.Add _
Anchor:=ActiveCell.Offset(0, -5), _
Address:="", _
SubAddress:="" & cl.Value & "!A1", _
TextToDisplay:=ActiveCell.Offset(0, -5).Value
Next cl
Thanks,
Bablu