Forum Discussion
Amitfre1
Aug 25, 2023Copper Contributor
retaining text format
Hi, I have this problem when I scrap data in the format of XXXX-XX-XX but when I open the Excel file it turns into a date format as follows: How do I keep the original format I scrapped? Than...
SnowMan55
Aug 27, 2023Bronze Contributor
Amitfre1With General-format cells, Excel looks at the user input for each cell (including a pasted value) and tries to determine if the input is a formula, a date value, a time value, a Boolean value, a percentage, a currency amount, or some other number*. If Excel decides it is any of those, it stores the value differently than the input characters. So some of your Case Number values looked like they were dates (in the YYYY-MM-DD format) and Excel stored them as dates, and displayed them in the date format it felt was appropriate based on your regional settings, etc.
The correction will involve two of these three steps:
- Manually edit each (inappropriate) date value in that column to the correct value, preceding each value with an apostrophe. As each cell is changed, Excel will then store those characters (rather than an internal representation of a date, as was the case before this edit).
- When that editing is done for all the bad-content cells… If there is no content beneath the table in the Case Numbers column, select the entire spreadsheet column, and format it as Text. Then you can skip step 3.
- Otherwise, when that editing is done for all the bad-content cells, select all the cells in that table column (including any empty cells), and format them as Text. Then, in the future, as table rows are added, the new Case Number cells will probably already be formatted as Text, and Excel will not try to interpret their input.
* I might be forgetting something in this list. Not important now.