Fixed Decimal Place Formatting

D

Db1712

Is there a way to change the formatting in a work book to a fixe
decimal place of two. That way if a number is entered into a cell e.g
269 it will appear as 2.69. I know you can set the option under th
tool menu to a fixed number which will change every work book unti
turned off. However, I want this to be only formatted for this wor
book. Thanks for any help with thi
 
P

Peo Sjoblom

Record a macro while you turn this on and off and use that piece of code in
a workbook open and before close
event, simplified assuming it is set to 2 decimal places already

Private Sub Workbook_Open()
Application.FixedDecimal = True
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.FixedDecimal = False
End Sub


press alt + F11 and double click ThisWorkbook

however if someone changes 2 decimals to 3 the that will be the norm so you
might want to put this in the macro itself

Private Sub Workbook_Open()
With Application
.FixedDecimal = True
.FixedDecimalPlaces = 2
End With
End Sub


--
Regards,

Peo Sjoblom

(No private emails please, for everyone's
benefit keep the discussion in the newsgroup/forum)
 
Top