Sheet Name Containing a Hyphen Gives an Error in Excel

ID: Q44012


The information in this article applies to:


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) 

Additional query words: 2.0 2.00 2.01 2.1 2.10 3.0


Keywords          : 
Version           : 
Platform          : 
Issue type        : 

Last Reviewed: March 12, 1999