Reputation: 105
I have an Excel file (containing Sheet1 only), with hyperlink formula in cell B3 (=HYPERLINK("#'Sheet1'!A1","link")) pointing to cell A1 of Sheet1. Then I copy Sheet1 (so have now Sheet1 and Sheet1(2)). Desired result: hyperlink formula in B2 of (a new) Sheet2 pointing to cell A1 of a new Sheet1(2) after clicking (by default it is pointing to cell A1 of old Sheet1). How can I improve the formula (=HYPERLINK("#'Sheet1'!A1","link")) so that it is pointing to the cell A1 of the new (current) spreadsheet Sheet1(2) (=I would like to have a (relative) reference to the current sheet robust to copying of sheet instead of (absolute) reference to the initial sheet)? Many thanks in advance!
Upvotes: 0
Views: 59
Reputation: 2614
rotabor's shorter method works well.
As rotabor commented, you could
target1=Sheet1!$A$1
, with scope set to Sheet1
=HYPERLINK("#target1","link")
You could try
=LET(
n, CELL("filename"),
sh, REPLACE(n, 1, FIND("]", n), ""),
HYPERLINK("#'" & sh & "'!A1", "link")
)
Upvotes: 0
Reputation: 4698
You need to exclude sheet's name from the hyperlink:
=HYPERLINK("#A1","link")
Upvotes: 1