Do not allow negative numbers in cell

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I restrict entry of positive numbers in a cell using data validation?
In other words I want only to be able to enter numbers that are less than 0.

Thanks.
 
Hey-

I found it. Select custom and if I am validating C3 the formula needs to be
=and(c3<0,isnumber(c3))
 
Hope this helps...


Sub DelZeros()
For X = 1 To 1
Dim redRng As Range
Set redRng = Range("A1", Range("A100").End(xlUp))
For Each Cell In redRng
If Cell.Value <= 0 Then
Cell.Value = 0
End If
Next Cell
Next X
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