Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You never define xsheet.
This worked for me: Sub AddLink() xSheet = "Sheet3" Sheets("Calendar").Activate Cells(ActiveCell.Row + 1, ActiveCell.Column).Select xAddress = xSheet & "!R1C1" ActiveSheet.Hyperlinks.Add Anchor:=Selection, _ Address:="", SubAddress:=xAddress, TextToDisplay:=xSheet End Sub Testing from the immediate window: ? Worksheets("Calendar").hyperlinks(1).SubAddress Sheet3!R1C1 I am using A1 addressing and it still worked, but I would recommend using the same addressing as your sheet. -- Regards, Tom Ogilvy "Marty Lindower" wrote in message ... Hi all- I'm trying to write some code to generate an appointment book, with each worksheet being a different day, with a master calendar page with clickable links that will take the user to the clicked day's sheet. The sheets are named with the date, ie, 10-14-03. The variable xSheet is the name of the sheet, ie "10-14-03". I've tried using this code: Sub AddLink() Sheets("Calendar").Activate Cells(ActiveCell.Row + 1, ActiveCell.Column).Select xAddress = xSheet & "!R1C1" ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:=xAddress, TextToDisplay:=xSheet End Sub It does generate a link, but when clicked, it comes up with a Reference Not Valid error. Can someone help me tweak this code so it works? Thanks, Marty |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Not at all clear on use of variables and/or object variables | Excel Discussion (Misc queries) | |||
Hyperlinks: Hyperlinks change on copy/paste? | Excel Worksheet Functions | |||
Update 2000 Excel hyperlinks to 2003 hyperlinks | Excel Worksheet Functions | |||
How toi turn-off hyperlinks [excel]? Email hyperlinks pop up ! | Excel Discussion (Misc queries) | |||
Excel Hyperlinks- cell content v. hyperlinks | Excel Discussion (Misc queries) |