Negative numbers

V

Vercingetorix.XIII

Is there a way to make a number be a negative number when it is entered in? I
need to add a total of figures and have it subtract from another total.
 
C

Candicehkjc

Selet the cell, then select format cells Select Custom and type -0. Then all
integer input with change to negative. e.g. type 123 will display -123.
 
G

Gord Dibben

That will "display" only.

The number will still be positive.


Gord Dibben MS Excel MVP
 
G

Gord Dibben

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
On Error GoTo endit
Application.EnableEvents = False
Target.Value = Target.Value * -1
End If
endit:
Application.EnableEvents = True
End Sub

This is sheet event code. Right-click on the sheet tab and "View Code"

Copy/paste the code into that module.

Alt + q to return to the Excel window.

Enter any numbers in column A as positive and they will become negative.


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top