Hyperlink - Reference is Invalid

stuartgb100

Active Member
Joined
May 10, 2015
Messages
322
Office Version
  1. 2021
Platform
  1. Windows
Hi,

I've a list of hyperlinks in sheet "#Artists-Index" (in the code this is TargetSht).
The links are generated from sheet "#Artists' Name & Album Titles" (in the code this is SourceSht).
All the links return the same error.

In the code I have:
VBA Code:
Set SourceSht = Sheets("#Artists' Name & Album Titles")   '2
'Set SourceSht = Sheets("#Master-Artists,Albums,Tracks")   '1
Set TargetSht = Sheets("#Artists-Index")

If I run the code using 1, it works.
If 2, it does not.

What I have found is this:
If I right click a working link and choose Edit Hyperlink, then I can see the correct cell reference.
However, all the 'not working' links show "A1".

Any ideas please ?
Thanks.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Thanks.

If I understood you correctly,
I changed the SourceSht name and then changed the Set line to:
VBA Code:
Set SourceSht = Sheets("#Artists'_Name_&_Album_Titles")

However, this gave the same error.

Cheers.
 
Upvote 0
Working now.

Tried several things and then found that the problem was the apostrophe.

Thanks again for your help.
Regards.
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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