Results 1 to 6 of 6
  1. #1
    Lounger
    Join Date
    Dec 2001
    Location
    Philadelphia, Pennsylvania, USA
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Worksheet Names (2002&2003)

    If I use letters of the alphabet as sheet names in a workbook, why do formulas that reference cells on the sheet named C require single quotes around the letter C?

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Worksheet Names (2002&2003)

    It occurs also with a sheet named 'R'. It is to explicitly to make them text. Similarly named ranges can not be named C or R, but other single letters are possible.

    It is due to XL's use of the RC convention for referencing cells (in addition to column letter /row number) making C and R "special characters"

    Note: you can add single quotes around any sheetname and it is not a problem. Particular ones just require it (eg C, R or a sheetname with a space)
    Steve

  3. #3
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Worksheet Names (2002&2003)

    It even works with "History". (Being a reserved name for sheets.

    BTW: I have Excel 2007. It does not allow single quotes around a sheet name (no matter what the name), but double quotes work. Is this a difference between the versions?
    Regards,
    Rudi

  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Worksheet Names (2002&2003)

    Rudi,
    I don't use XL2007 so you will have to wait for someone who has XL2007 to confirm, but based on what you said, it seems that yes it is a difference between the versions.

    This could play "havoc" wih some VB code, since often the single quotes are added by the code. It can be changed on an "as needed" basis, but if the code needs to work with both versions, then the "qualifier" character will have to be set at runtime based on the XL version (using for example "Application.Version" in the code)

    Steve

  5. #5
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Worksheet Names (2002&2003)

    Rudi,
    Do you mean single quotes around the sheet name when naming the sheet? (i.e. actually calling a sheet <code>'sheet1'</code> for example?) If so, I'm not sure you can do that in any version - you can have an apostrophe within a sheet name but it cannot begin or end with one.
    Regards,
    Rory

    Microsoft MVP - Excel

  6. #6
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Worksheet Names (2002&2003)

    Rory, you are quite right...in a lapse of concentration, which tends to happen often over weekends <img src=/S/grin.gif border=0 alt=grin width=15 height=15>, I thought klugherz was refering to quotes around the 'actual' sheetname, of stead of what he sees in the formula bar. <img src=/S/stupidme.gif border=0 alt=stupidme width=30 height=30>

    With this news, Steve... there is no need to worry about the effects it would have on VBA...phew!! <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    Regards,
    Rudi

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •