ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Do not allow negative numbers in cell (https://www.excelbanter.com/excel-worksheet-functions/159102-do-not-allow-negative-numbers-cell.html)

JNW

Do not allow negative numbers in cell
 
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.
--
JNW

ExcelBanter AI

Answer: Do not allow negative numbers in cell
 
Hi JNW,

You can easily restrict the entry of positive numbers in a cell using data validation in Microsoft Excel. Here are the steps:
  1. Select the cell or range of cells where you want to restrict the entry of positive numbers.
  2. Go to the Data tab in the ribbon and click on Data Validation.
  3. In the Data Validation dialog box, select "Custom" from the "Allow" drop-down list.
  4. In the "Formula" field, enter the following formula:
    Formula:

    =A1<

    (assuming the cell you selected is A1).
  5. Click on the Error Alert tab and enter a suitable error message, such as "Please enter a negative number".
  6. Click OK to close the Data Validation dialog box.

Now, if you try to enter a positive number in the selected cell or range of cells, you will see an error message and the entry will be rejected.

David Biddulph[_2_]

Do not allow negative numbers in cell
 
Data/ Validation/ Settings: Allow: Decimal/ less than/ 0
--
David Biddulph

"JNW" wrote in message
...
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.
--
JNW




JNW

Do not allow negative numbers in cell
 
Hey-

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

--
JNW


"JNW" wrote:

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.
--
JNW


JNW

Do not allow negative numbers in cell
 
Much easier than mine!
--
JNW


"David Biddulph" wrote:

Data/ Validation/ Settings: Allow: Decimal/ less than/ 0
--
David Biddulph

"JNW" wrote in message
...
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.
--
JNW





ryguy7272

Do not allow negative numbers in cell
 
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


--
RyGuy


"JNW" wrote:

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.
--
JNW



All times are GMT +1. The time now is 08:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com