Hyperlink with variable workbook and sheet name

khardu

Board Regular
Joined
Jan 18, 2012
Messages
68
Hello there!

How can I use "HYPERLINK(link_location, [friendly_name])" with variable workbook and sheet name and spece between their names.

I linked the "[friendly_name]" to sheet name.The argument "[friendly_name]" doesn't allow the hyperlink to work if there's a space between either workbook name or sheet name.

Following are the details:

Workbook name: My Workbook
Sheet name: My Sheet 1
My Sheet 2

I'm trying to link a Cell "A1" on "My Sheet 1" to a Cell "B1" on "My Sheet 2" with the following formula:

=HYPERLINK(CELL("address",'My Sheet 2'!B1),REPLACE(CELL("filename",A1),1,FIND("]",CELL("filename",A1)),""))

Excel accepts the arguments happily, but when I try to go to cell "B1" in "My Sheet 2" by clicking on Cell "A1" in "My Sheet 1", a box appears saying "Cannot open the specified file"


Hope it makes clear.
Thanking you in advance.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,223,246
Messages
6,170,996
Members
452,373
Latest member
TimReeks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top