![]() |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
![]()
I have written following macro to hyperlink Excel cells to worksheets based on the cell value. It failes to work for sheets whose name include “-“. (See cell A4 in the excel attachment.)
Can you guide me on this issue? Sub FShyeperlink() On Error Resume Next Dim n As Integer Dim i As Integer Dim rng As Range n = Selection.Rows.Count Set rng = Selection Selection.Hyperlinks.Delete For i = 1 To n rng(i).Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _ Selection.Value & "!A1" Next i End Sub |
Tags |
hyperlink |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Merging 2 different cells containing IF formula & change in cell values based on multiple time frame | jay_excel | Excel | 0 | 07-29-2017 11:04 PM |
![]() |
Elton Wolter | Excel Programming | 4 | 04-16-2016 08:44 AM |
![]() |
rpcalo | Excel | 3 | 03-10-2016 03:38 AM |
![]() |
lwls | Excel Programming | 5 | 11-08-2014 02:11 PM |
Change values in cells based on criteria | SaneMan | Excel Programming | 2 | 02-02-2012 07:58 AM |