Hyperlink Formula

jstevens
GoldLounger
Posts: 2631
Joined: 26 Jan 2010, 16:31
Location: Southern California

Hyperlink Formula

Post by jstevens »

Is it possible to reference the active workbook name in the formula?

Example: =HYPERLINK("[ActiveWorkbook]MySheet!A1", "<<<Back")
Regards,
John

User avatar
HansV
Administrator
Posts: 78548
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Hyperlink Formula

Post by HansV »

You can use # to refer to the active workbook:

=HYPERLINK("#MySheet!A1", "<<<Back")
Best wishes,
Hans

jstevens
GoldLounger
Posts: 2631
Joined: 26 Jan 2010, 16:31
Location: Southern California

Re: Hyperlink Formula

Post by jstevens »

Hans,

I receive an error message: Reference is not valid.
Regards,
John

User avatar
HansV
Administrator
Posts: 78548
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Hyperlink Formula

Post by HansV »

Does the actual sheet name contain spaces or punctuation?
Best wishes,
Hans

jstevens
GoldLounger
Posts: 2631
Joined: 26 Jan 2010, 16:31
Location: Southern California

Re: Hyperlink Formula

Post by jstevens »

Hans,

It fails because there are blank spaces in the sheet name such as "My Sheet". It works fine if the sheet name does not contain blanks in it ie "MySheet".
Regards,
John

jstevens
GoldLounger
Posts: 2631
Joined: 26 Jan 2010, 16:31
Location: Southern California

Re: Hyperlink Formula

Post by jstevens »

Hans,

The resolution is to place an apostrophe in the formula before and after the sheet name.

=HYPERLINK("#'My Sheet'!A1", "<<<Back")
Regards,
John

User avatar
HansV
Administrator
Posts: 78548
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Hyperlink Formula

Post by HansV »

Yes, that is the same as in a cell formula: if you refer to a worksheet whose name contains spaces or punctuation, you need to enclose its name in single quotes (apostrophes).
Best wishes,
Hans