This problem is simple to correct but is very very annoying
what I'm doing is to type a hour range, eg. (0-1),(1-2),(2-3) so on
per cell row
DATE --- HOUR
1/1/2013 0-1
1/1/2013 1-2
1/1/2013 2-3
1/1/2013 3-4
Excel stupidly keeps formatting 1-2 to a date 2-Jan
to make matters worse is when I change it to a number format
it gives 41276
I also cannot find the AutoFormat option in excel 2010, I am aware of the Format button in home but there is no autoformat there.
54 Answers
Before you enter any values in the column/cells, change the cell format to Text.
Or, put this in the Workbook code module to force this formatting on all sheets, each time the workbook is opened.
Private Sub Workbook_Open()
Dim sh As Worksheet
For Each sh In Me.Sheets sh.Cells.NumberFormat = "@"
Next
End Sub 7 - cut and paste everything into note_pad
- delete what ever left in xl
- Select all needed cells, columns row to text format
- re-paste from note_pad
- if you need later you can change to date, time formats
- Select all your '.csv' data and copy to notepad
- Set all cells in new worksheet in Excel to text
- Paste all your data from Notepad as text
- Copy the "affected" column back to Notepad
- Change all your
.to,(e.g. 10.00 to 10,00) - Open new Excel book - IMPORTANT
- Copy your column from Notepad to this new Excel book
- Copy and paste the column back to your original Excel book
The only drawback is that you have your numbers now with (,) instead of (.).
Another way is:
- save sheet as CSV
- rename it to
.txt - reopen it in Excel
- import module is invoked
- switch from general to text format for each numeric column