negative number

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I got this answer here before but lost it!
How do I get a number to disply as a negative number even if it is entered
as positive?
in other words i enter 45 but -45 appears.
I thought someone gave me a macro for this but i can't find it
thanks
 
Press Ctrl+1, Number tab, click Custom, and insert:

-General;-General

to the right.

HTH
Jason
Atlanta, GA
 
yeah... tried that but can't use it in sums. Doesn't add it correctly.
any other ideas?
thanks
 
see my post under Miscellaneous. Summing seems to work
okay. It looks like you want only the APPEARANCE of a
negative number. Jason's answer was better than mine for
decimal control, but needed to say "-"General;-General
 
Thanks
yeah, I am pretty sure the last time I did this someone came up with a macro
that I could set a range that would behave this way. So that any number
entered would be made negative and would also work as a negative number in
and formulas or sums.
hmmmm....
 
ok... I have narrowed it down...... the workbook says it has a macro in it
when I first open it and if I disable it It wont do the negative number
thing, but when I look in Macros it is not there.... what is up with that?
 
Right click the sheet tab of sheet1 and paste this code

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
For Each c In Worksheets("Sheet1").Range("A1:A10")
If c.Value > 0 Then
c.Value = c.Value * -1
End If
Next c
End Sub

this will convert every positive value to a negative in A1:A10 when
you leave the cell (when you press enter)

--
For everyone's benefit keep the discussion in the newsgroup.

Regards,

Peo Sjoblom
 
thats it!
thanks


Peo Sjoblom said:
Right click the sheet tab of sheet1 and paste this code

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
For Each c In Worksheets("Sheet1").Range("A1:A10")
If c.Value > 0 Then
c.Value = c.Value * -1
End If
Next c
End Sub

this will convert every positive value to a negative in A1:A10 when
you leave the cell (when you press enter)

--
For everyone's benefit keep the discussion in the newsgroup.

Regards,

Peo Sjoblom
 
one last thing.... how do I add another range to that... I have another row
I want to behave the samne way
thanks
 
Back
Top