How can I set up a macro which links a cell in one sheet to the same cell in another sheet ( e.g sheet1!C7 to sheet2!C7)?
I have the following macro:
currCell = ActiveCell.Address
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
"sheet2!" & currCell
which would give me the link sheet2!$D$7, to which excel says "reference is not valid." Is there a way to take a relative, rather than absolute link from a selected cell, and would this relative link (sheet2!D7) be valid?
Your code works fine.
are you sure your sheet names are valid. Can you post workbook where your code errors.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks