Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / September 2007

Tip: Looking for answers? Try searching our database.

How do I make a column formatted for only Negative Numbers?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DeeDeeCee - 03 Sep 2007 09:50 GMT
I'm trying to add-subtract various numbers. One column will be nothing but
withdrawals from an account, so I want every number to be negative, so that
if I do calculations with that column, they will always show as deductions.
Is there a way I can set up the cells in that column so that any number I
type in will show as a negative number, ie. a -xx? I can simply type in a
hyphen before, I know, but I like to type fast without even thinking about
that extra and somewhat difficult (for me) key-stroke. Thanks.

dc
David Biddulph - 03 Sep 2007 10:26 GMT
One option once you've entered all the numbers as positive is to put -1 in a
spare cell, select and copy, the select your column, edit/ paste special/
multiply.

If you just want that column to display as if they were negative numbers,
you could format as "-"General, and then when you want to do calculations
from that column you could subtract instead of adding.
Signature

David Biddulph

> I'm trying to add-subtract various numbers. One column will be nothing but
> withdrawals from an account, so I want every number to be negative, so
[quoted text clipped - 7 lines]
>
> dc
Stan Brown - 03 Sep 2007 13:06 GMT
Mon, 3 Sep 2007 01:50:07 -0700 from DeeDeeCee
<DeeDeeCee@discussions.microsoft.com>:

> I'm trying to add-subtract various numbers. One column will be nothing but
> withdrawals from an account, so I want every number to be negative, so that
> if I do calculations with that column, they will always show as deductions.
> Is there a way I can set up the cells in that column so that any number I
> type in will show as a negative number, ie. a -xx?

Yes, with custom formatting, but I recommend against it. When you see
a column of negative numbers, sooner or later you'll type a minus
sign in front of one of them and then your computation will give a
wrong result.

Signature

"First prove what you're saying, then whine about it."
                              -- /The People's Court/
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
                                 http://OakRoadSystems.com/

Gord Dibben - 04 Sep 2007 15:54 GMT
I know I'm a day late here but if you're still watching............

You could use event code to change the typed numbers to real negatives as you
enter them.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'change a number to negative
      If Target.Column <> 2 Then Exit Sub
      If Not IsNumeric(Target.Value) Then Exit Sub
      If Not Left(Target.Value, 1) = "-" Then
    Application.EnableEvents = False
    With Target
        .Value = .Value * -1
       End With
End If
Application.EnableEvents = True
End Sub

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

Copy/paste into that sheet module.

As written it operates on column 2(B) only.  Adjust to suit column number.

Gord Dibben  MS Excel MVP

>I'm trying to add-subtract various numbers. One column will be nothing but
>withdrawals from an account, so I want every number to be negative, so that
[quoted text clipped - 5 lines]
>
>dc
DeeDeeCee - 05 Sep 2007 11:14 GMT
Thanks to all 3; I got useful info from each.

ddc

> I know I'm a day late here but if you're still watching............
>
[quoted text clipped - 31 lines]
> >
> >dc
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.