Automatically change the cell from general to date

iamdinesh 69 Posts Tuesday December 4, 2012Registration date March 9, 2018 Last seen - Mar 9, 2018 at 02:10 AM - Latest reply: TrowaD 2369 Posts Sunday September 12, 2010Registration dateModeratorStatus June 21, 2018 Last seen
- Mar 12, 2018 at 01:07 PM
Hello,





Somehow i am facing an issue again and again in my office 365 excel, when i save the file with general cells format for number values, when i again open the same file it automatically change the cell from general to date format it create lots of time to re-correct the file, and it is happening again and again when re open the file can someone help regarding to this issue

See more 

Your reply

1 reply

TrowaD 2369 Posts Sunday September 12, 2010Registration dateModeratorStatus June 21, 2018 Last seen - Updated by TrowaD on 12/03/18 at 01:12 PM
0
Thank you
Hi Deesh,

Have you created the file using your current Excel version or is it an 'old' file that you are now opening with your current Excel version?

Might be a conversion issue. So try to recreate your workbook.

In case that fails. The following code will change all cells to number format with 2 decimals on all sheets upon opening your workbook. First you need to implement the code, save your workbook and then re-open to see the result.

Private Sub Workbook_Open()
Dim ws As Worksheet
For Each ws In Worksheets
    With ws
        .Cells.NumberFormat = "0.00"
    End With
Next ws
End Sub


Code needs to be placed under ThisWorkbook:

Hopefully this will solve/help with your unusual query.

Best regards,
Trowa

Respond to TrowaD