Display number as negatiove always

J

jtees4

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.
 
G

Gord Dibben

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
 
J

jtees4

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!
 
J

jtees4

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!

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!
 
G

Gord Dibben

Thanks for the feedback.

Gord

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!
 
Top