Format cell for negative

  • Thread starter Thread starter es
  • Start date Start date
E

es

Hi
I want the value that i type into a cell always to be
negative

thanks
 
Hi,

You need to adjust the format of the cell - this one for instance: -*
#,##0_-;-* #,##0_-;_-* "-"_-;_-@_-

Notice that the format starts with "-".

Go to Format->Cells->Number and paste this format in the custom part.

Cheers,
Jon
 
Is there a specific Cell or range of cells on your worksheet that you want
this?
Or any and all cells on any Worksheet?
 
In either case:

'Compliments of
'Ron Rosenfeld Apr 8 2003, 4:28 am
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Dim c As Range, aoi As Range
Set aoi = [A1:D10] 'range to make all negative numbers
For Each c In aoi
If Len(c.Text) > 0 Then 'Is anything there?
If Not Left(c.Formula, 1) = "=" Then 'ignore if a formula
If IsNumeric(c.Value) Then 'make sure it's a number
c.Value = -Abs(c.Value)
End If
End If
End If
Next c
Application.EnableEvents = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top