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 / January 2007

Tip: Looking for answers? Try searching our database.

Display number as negatiove always

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jtees4 - 10 Jan 2007 00:42 GMT
Easy one for you pros (I think).
Is there a way to set up a cell to always display a number typed into
it as a negative number? Thanks for any help.
Gord Dibben - 10 Jan 2007 01:15 GMT
Display or actually become a negative number?

Display...........Format>Cells>Custom  -#,##0.00  but they would still be
positive numbers.

To actually become negative would require VBA.

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

>Easy one for you pros (I think).
>Is there a way to set up a cell to always display a number typed into
>it as a negative number? Thanks for any help.
jtees4 - 10 Jan 2007 12:26 GMT
Good question. I don't know the answer, it's actually for my wife. I
will get a copy of ther spredsheet later today and see which it is. I
suspect it's "actually become". Thanks for the info either way!

>Display or actually become a negative number?
>
[quoted text clipped - 30 lines]
>>Is there a way to set up a cell to always display a number typed into
>>it as a negative number? Thanks for any help.
jtees4 - 10 Jan 2007 14:36 GMT
>Good question. I don't know the answer, it's actually for my wife. I
>will get a copy of ther spredsheet later today and see which it is. I
[quoted text clipped - 34 lines]
>>>Is there a way to set up a cell to always display a number typed into
>>>it as a negative number? Thanks for any help.

I was wrong. There was actually no need to make it actually
negative...the format thing worked like a charm I just changed it to
show as brackets instead of a negative sign. Thank you!
Gord Dibben - 10 Jan 2007 20:28 GMT
Thanks for the feedback.

Gord

>>Good question. I don't know the answer, it's actually for my wife. I
>>will get a copy of ther spredsheet later today and see which it is. I
[quoted text clipped - 38 lines]
>negative...the format thing worked like a charm I just changed it to
>show as brackets instead of a negative sign. Thank you!

Rate this thread:






 
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.