maxhayden
05-27-2009, 05:00 AM
Hello there.
I have a peice of code that creates a new worksheet and names in Link1, 2 , 3... etc depending on the sheet order:
.Copy after:=Sheets(Sheets.Count)
ActiveSheet.Name = "Link " & Worksheets.Count - 2
I want to create a hyperlink to each new worksheet. I did this using the following code but the link doesn't work:
ActiveSheet.Cells(h, 5).Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
"Link" & Worksheets.Count - 2, TextToDisplay:="Click Here"
Can someone tell me what I'm doing wrong??
Ps. When I move my mouse over the "Click Here" link, ti comes up saying Link1 (so the naming must work). I think it is missing the !A1 cell reference at the end, but I'm not sure how to fit that in.
Thanks in advance for your help.
PS. And extra thought... It says Link1 on the hyperlink... when it should say Link 1... (missing the space!!) Hmmm...
I have a peice of code that creates a new worksheet and names in Link1, 2 , 3... etc depending on the sheet order:
.Copy after:=Sheets(Sheets.Count)
ActiveSheet.Name = "Link " & Worksheets.Count - 2
I want to create a hyperlink to each new worksheet. I did this using the following code but the link doesn't work:
ActiveSheet.Cells(h, 5).Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
"Link" & Worksheets.Count - 2, TextToDisplay:="Click Here"
Can someone tell me what I'm doing wrong??
Ps. When I move my mouse over the "Click Here" link, ti comes up saying Link1 (so the naming must work). I think it is missing the !A1 cell reference at the end, but I'm not sure how to fit that in.
Thanks in advance for your help.
PS. And extra thought... It says Link1 on the hyperlink... when it should say Link 1... (missing the space!!) Hmmm...