Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Hyperlink
Hi All,
I have 10 sheets and all the sheets name are in sheet1 col A. I want to create hyperlinks. eg.col A Asset Liability If I click asset it moves to the sheet named Asset. I am using this macro it works fine, but if any space in sheet names it gives error. Sub hyp() For i = 1 To 3 shtn = Cells(i, 1).Value Cells(i, 1).Select Selection.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _ shtn & "!A1", TextToDisplay:=shtn Next End Sub |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Hyperlink
You need to put '' around the sheetname if it contains spaces...
Try Sub hyp() For i = 1 To 3 shtn = Cells(i, 1).Value Cells(i, 1).Select Selection.Hyperlinks.Add Anchor:=Selection, Address:="", _ SubAddress:="'" & shtn & "'!A1", TextToDisplay:=shtn Next End Sub " wrote: Hi All, I have 10 sheets and all the sheets name are in sheet1 col A. I want to create hyperlinks. eg.col A Asset Liability If I click asset it moves to the sheet named Asset. I am using this macro it works fine, but if any space in sheet names it gives error. Sub hyp() For i = 1 To 3 shtn = Cells(i, 1).Value Cells(i, 1).Select Selection.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _ shtn & "!A1", TextToDisplay:=shtn Next End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Convert hyperlink function into hyperlink | Excel Worksheet Functions | |||
Can't make hyperlink function work for hyperlink to website | Excel Worksheet Functions | |||
How do I create a hyperlink to a cell with the hyperlink function | Excel Worksheet Functions | |||
Moving rows with Hyperlink doesn't move hyperlink address | Excel Discussion (Misc queries) | |||
Intra-workbook hyperlink: macro/function to return to hyperlink ce | Excel Discussion (Misc queries) |