Change minus numbers to zero in cell

D

Don Guillett

Sub chgnegnumtozero()
For Each c In Selection
If c.Value < 0 Then c.Value = 0
Next
End Sub
 
G

Gord Dibben

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
 

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

Top