Referencing sheets with spaces

Posted by user2250964 on Stack Overflow See other posts from Stack Overflow or by user2250964
Published on 2013-07-22T13:29:46Z Indexed on 2014/06/13 15:25 UTC
Read the original article Hit count: 134

Filed under:
|
|

I am having an issue with referencing the sheet name through =Branded!$A$1 Notation in VBA. For a while I have passed in simple sheet names like:

Dim SheetName As String
SheetName = "Pizza"
("=" & SheetName & "!$A$1")

This has worked fine, but recently I passed in "Tier 1" and of course this notation broke. Is there any fix or workaround for this? It Think it's because of the space, the number or both....

© Stack Overflow or respective owner

Related posts about excel

Related posts about vba