ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Negative numbers (https://www.excelbanter.com/excel-worksheet-functions/203339-negative-numbers.html)

Vercingetorix.XIII[_2_]

Negative numbers
 
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.

David Biddulph[_2_]

Negative numbers
 
Yes. Type in a minus sign - before the number.
--
David Biddulph

"Vercingetorix.XIII" wrote in
message ...
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.




Candicehkjc

Negative numbers
 
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.

"Vercingetorix.XIII" wrote:

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.


David Biddulph[_2_]

Negative numbers
 
And do you think that the arithmetic will treat that as a negative number as
the OP requested, Candice, or will it do the same as other formatting and
merely change the *display* of the number?
--
David Biddulph

"Candicehkjc" wrote in message
...
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.

"Vercingetorix.XIII" wrote:

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.




Gord Dibben

Negative numbers
 
That will "display" only.

The number will still be positive.


Gord Dibben MS Excel MVP

On Sun, 21 Sep 2008 08:42:01 -0700, Candicehkjc
wrote:

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.

"Vercingetorix.XIII" wrote:

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.



Gord Dibben

Negative numbers
 
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


On Sun, 21 Sep 2008 07:49:00 -0700, Vercingetorix.XIII
wrote:

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.




All times are GMT +1. The time now is 08:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com