Change minus numbers to zero in cell

  • Thread starter Thread starter Bob
  • Start date Start date
Sub chgnegnumtozero()
For Each c In Selection
If c.Value < 0 Then c.Value = 0
Next
End Sub
 
Enter 0 in an unused cell.

Copy that.

Select your negative number cells and Paste Special(in place)>Value>OK>Esc.

If you have formulas that return a negative number and wish to preserve the
formulas, change the formulas to something like

=MAX(0,A1-A2)

If A1-A2 is negative, the result will be 0.


Gord Dibben MS Excel MVP
 
Back
Top