• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Number formatting by default

Greetings!!


I have to manually adjust the number formatting i.e. 12345 to 12,345(without decimal)


Is there any way to get this feature by default on new and old files


Regards

Neeraj Kumar Agarwal
 
Here's one way to do it.

1. As vletm suggested, go to "Style" ribbon tool and right click on "Normal" and modify (or add another rule). And set it to number format of your choice.

2. Then save the blank file as template. Any new workbook created with this template will inherit style setting.

3. If you want to make it default template, save the template in XLSTART folder.
 
Here's one more idea. You can implement a code like below which will apply formatting to a cell automatically if cell has no format set to it. It goes in thisworkbook module.

Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim rg As Range
For Each rg In Target
    If rg.NumberFormat = "General" Then
        rg.NumberFormat = "#,##0"
    End If
Next
End Sub
 
Back
Top