ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   negative numbers (https://www.excelbanter.com/excel-discussion-misc-queries/120864-negative-numbers.html)

gypsy

negative numbers
 
can I format a column so that when I type in the number in the cell, it will
automatically appear as a negative. I don't want to always do -_____then the
number.

Thanks.

Toppers

negative numbers
 
Try Format Cells == Custom as "-#" (no quotes)

"gypsy" wrote:

can I format a column so that when I type in the number in the cell, it will
automatically appear as a negative. I don't want to always do -_____then the
number.

Thanks.


T. Valko

negative numbers
 
Just so the OP is aware.....

That doesn't make the number a negative number. It's just a positive number
with a minus sign in front of it. You would need an event macro to change a
positive number to negative number.

Biff

"Toppers" wrote in message
...
Try Format Cells == Custom as "-#" (no quotes)

"gypsy" wrote:

can I format a column so that when I type in the number in the cell, it
will
automatically appear as a negative. I don't want to always do -_____then
the
number.

Thanks.




Toppers

negative numbers
 
Thanks Biff. I'll to stop replying in the early morning as my limited brain
isn't in gear.

"T. Valko" wrote:

Just so the OP is aware.....

That doesn't make the number a negative number. It's just a positive number
with a minus sign in front of it. You would need an event macro to change a
positive number to negative number.

Biff

"Toppers" wrote in message
...
Try Format Cells == Custom as "-#" (no quotes)

"gypsy" wrote:

can I format a column so that when I type in the number in the cell, it
will
automatically appear as a negative. I don't want to always do -_____then
the
number.

Thanks.





Gord Dibben

negative numbers
 
gypsy

You cannot pre-format the cells as negative.

You could use event code to change them to negative as you enter.

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1:A10")) Is Nothing Then
With Target
If .Value < "" Then
.Value = .Value * -1
End If
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub

Right-click on the sheet tab and "View Code"

Copy/paste the above into that module.

Edit the range of A1:A10 to suit.


Gord Dibben MS Excel MVP


On Thu, 30 Nov 2006 17:47:00 -0800, gypsy
wrote:

can I format a column so that when I type in the number in the cell, it will
automatically appear as a negative. I don't want to always do -_____then the
number.

Thanks.


Gord Dibben MS Excel MVP


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

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