Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to reference worksheet name with spaces?
I've read that single quotes are supposed to allow you to reference
worksheet names with spaces: 'Year 2004_0' But I'm using automation (from Access) and it's not working: sn = 'Year 2004_0' lr = xlapp.Workbooks(strXlsFile).Worksheets(sn) _ .Range("A1").SpecialCells(xlCellTypeLastCell).Row This returns "Error Number 9: Subscript out of range" (works fine if no spaces in worksheet name) I've also tried: ['Year 2004_0'] but no luck. How can I reference a worksheet name with spaces when using automation? Thanks in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Deleting unwanted lead spaces throughout a worksheet | Excel Worksheet Functions | |||
remove spaces in linked worksheet object | Excel Worksheet Functions | |||
how do I remove leading spaces and leave the remianing spaces w | Excel Worksheet Functions | |||
Macro that double spaces rows for an entire worksheet? | Excel Discussion (Misc queries) | |||
I want in one worksheet to relatively link to/reference cells in another without changing the format of the current worksheet. | Excel Discussion (Misc queries) |