Sheet Name Containing a Hyphen Gives an Error in Excel

Last reviewed: November 30, 1994
Article ID: Q44012
The information in this article applies to:
  • Microsoft Excel for Windows, versions 2.x, 3.0, 4.0, 5.0
  • Microsoft Excel for the Macintosh, versions 4.0, 5.0

SUMMARY

Both the TEXTREF macro function and the FORMULA macro function give an error message if the sheet name contains a hyphen (for example, "sheet-1.xls").

These error messages seem to be caused by the hyphen in the name. If you take the hyphen out, the error disappears. Hyphens seem to be a problem only if the hyphen is in an actual sheet name; a hyphen in another part of a FORMULA or TEXTREF statement does not seem to cause the problem.

The following are examples of statements that can cause the error:

   =TEXTREF("SHEET-1.XLS!$A$4",TRUE)                       #REF!

   =FORMULA("=sheet-1.xls!r4c1",SHEET1.XLS!$A$2)           #VALUE!
   =FORMULA("=sheet-1.xls!r4c1",'SHEET-1.XLS'!$A$2)        #VALUE!

The following do not cause an error:

   =FORMULA("=sheet1.xls!r1c1",SHEET1.XLS!$A$2)
   =FORMULA("=sheet1.xls!r1c1",'SHEET-1.XLS'!$A$2)
   =FORMULA("-",'SHEET-1.XLS'!$A$2)


KBCategory: kbother
KBSubcategory:

Additional reference words: 2.0 2.00 2.01 2.1 2.10 3.0 3.00
4.0 4.00 5.00


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 30, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.