Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I wanted to ask the proper way to enter a String into Range() that contains a space (or many spaces) in it. For example (the excerpt from my macro which triggers
the error): cell_name = "sheet name with spaces!$A$1" foo = q & Range(cell_adr) & q & "," (I've set q to be the double quotation character). I suspect the error occurs because of the spaces because if I change the sheet's name to say, "sheetwithnospaces" then there's no problem. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try wrapping the sheet name in single quotes:
cell_name = "'sheet name with spaces'!$A$1" -- Rob van Gelder - http://www.vangelder.co.nz/excel "Minilek" wrote in message ... I wanted to ask the proper way to enter a String into Range() that contains a space (or many spaces) in it. For example (the excerpt from my macro which triggers the error): cell_name = "sheet name with spaces!$A$1" foo = q & Range(cell_adr) & q & "," (I've set q to be the double quotation character). I suspect the error occurs because of the spaces because if I change the sheet's name to say, "sheetwithnospaces" then there's no problem. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It worked. Thanks.
"Rob van Gelder" wrote: Try wrapping the sheet name in single quotes: cell_name = "'sheet name with spaces'!$A$1" -- Rob van Gelder - http://www.vangelder.co.nz/excel "Minilek" wrote in message ... I wanted to ask the proper way to enter a String into Range() that contains a space (or many spaces) in it. For example (the excerpt from my macro which triggers the error): cell_name = "sheet name with spaces!$A$1" foo = q & Range(cell_adr) & q & "," (I've set q to be the double quotation character). I suspect the error occurs because of the spaces because if I change the sheet's name to say, "sheetwithnospaces" then there's no problem. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Another question regarding matching names and adding spaces | Excel Worksheet Functions | |||
Matching names and inserting spaces | Excel Worksheet Functions | |||
Matching names and inserting spaces | Excel Worksheet Functions | |||
Open Excel file get error with file names that have spaces in the | Setting up and Configuration of Excel | |||
formula to bring value from another sheet with different spaces | Excel Discussion (Misc queries) |