how to auto add zero in the cell

December 27, 2010 at 19:52:25
Specs: Windows XP
Is it possible to auto add zero to the value in the cell. Let say if i key in digit 5 in the cell, then it will auto convert to 5,000. Cause in accounting, if need to key in too many zero can mix up. Thanks

See More: how to auto add zero in the cell

Report •

December 28, 2010 at 05:35:05
This Worksheet_Change macro will multiply the entry by 1000.

As written, it will work for Column A only.

Right-click the sheet tab where you want this happen, choose View Code and paste the code into the pane that opens.

As always, test the code in a backup copy of your workbook since macros can not be undone.

Private Sub Worksheet_Change(ByVal Target As Range)
 Application.EnableEvents = False
   If Target.Column = 1 Then
     If WorksheetFunction.IsNumber(Target) Then
      Target = Target * 1000
    End If
   End If
  Application.EnableEvents = True
End Sub

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Report •
Related Solutions

Ask Question