spaces (1 Viewer)

N1234

Member
Local time
Today, 07:13
Joined
Jun 22, 2020
Messages
64
Hello again!

I'm currently trying to hyperlink to specific excel worksheet names that have spaces in them. I can get it the hyperlink working without the spaces i.e:
C:\Users\Desktop\Excel.xlsx#Sheet1!A1. But if there's a space between Sheet and 1, i.e: Sheet 1, I can not longer get the hyperlink to work.

I've tried C:\Users\Desktop\Excel.xlsx![Sheet1]!A1 and C:\Users\Desktop\Excel.xlsx#'Sheet 1'!A1 but they both produce errors.

Thanks again for your help!
 

Isaac

Lifelong Learner
Local time
Today, 04:13
Joined
Mar 14, 2017
Messages
8,738
Skip the hyperlink and just write code to open the path when they click somewhere/thing
 

bastanu

AWF VIP
Local time
Today, 04:13
Joined
Apr 13, 2010
Messages
1,401
Have you tried C:\Users\Desktop\Excel.xlsx#'" & "Sheet 1" & "'!A1?

Cheers,
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 07:13
Joined
Feb 19, 2002
Messages
42,970
Whenever a variable contains spaces or non-standard characters, you should enclose the string in double quotes.
Code:
FollowHyperlink  & """" & Me.txtLink & """"
 

CJ_London

Super Moderator
Staff member
Local time
Today, 11:13
Joined
Feb 19, 2013
Messages
16,553
so far as I am aware, excel does not allow spaces in range names
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:13
Joined
Sep 21, 2011
Messages
14,038
so far as I am aware, excel does not allow spaces in range names
Sheet names are fine though?
1606911284904.png
 

Users who are viewing this thread

Top Bottom