XL: Unexpected Behavior with Numbers Formatted as TextLast reviewed: February 2, 1998Article ID: Q141765 |
The information in this article applies to:
SYMPTOMSIn Microsoft Excel, if a number is formatted with the Text number format, and you attempt to change the format to something other than Text, the number may not be changed as you expect.
WORKAROUNDTo work around this behavior, use any of the following methods to reenter the numbers in the reformatted cells.
Method 1: Retype the NumbersAfter you change the format, retype the numbers.
Method 2: Select Edit Directly In CellOn the Tools menu, click Options or Preferences, click the Edit tab, and verify that the Edit Directly In Cell check box is selected. Double-click the cell you want to format, and press ENTER.
Method 3: Use a Visual Basic for Applications ProcedureMicrosoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:
http://www.microsoft.com/supportnet/refguide/Create a Visual Basic for Applications macro to reenter the numbers in the selected cell or range of cells. Type the following code in a module sheet:
Sub Enter_Values() For Each xCell In Selection xCell.Value = xCell.Value Next xCell End SubBefore you run this procedure, switch to the worksheet that contains the numbers you want to reentered, select the range of cells that contain those numbers, and then run the macro.
Method 4: Use Paste SpecialTo use this method, follow these steps:
STATUSThis behavior is by design. When you format a cell using the Text number format, the cell is changed and anything that is entered is displayed as text.
MORE INFORMATIONTo format a number as text, follow these steps:
NOTE: If numbers are entered before the cells are formatted to use the Text number format, they remain numbers, but they are aligned to the left in the cell to appear as text.
REFERENCESMicrosoft Excel 7.0, Microsoft Excel 97, and Microsoft Excel 98 Macintosh Edition For more information about formatting numbers as text, click the Answer Wizard in Help and type:
How do I format numbers as text Microsoft Excel 5.0"User's Guide," version 5.0, Chapter 9, "How Microsoft Excel Interprets What You Enter" For more information about Formatting numbers as text, click the Search button in Help and type:
numbers, formatting |
Additional query words: 5.00 7.00 8.00 97 XL97 98 XL98
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |