Aug 13 2021 12:10 AM
Hi. I want to restrict someone putting an amount more than 2 decimals into a cells.
Thanks guys.
Aug 13 2021 12:26 AM
Using data validation:
Select the cells you want to apply the rule to. In the following, I will assume that A1 is the active cell in the selection.
On the Data tab of the ribbon, click Data Validation.
Select Custom from the Allow dropdown.
Enter the formula
=MOD(100*A1,1)=0
where A1 is the active cell.
Specify messages in the Input Message and Error Alert tabs, if you wish.
Click OK.
Alternatively, you could use the Worksheet_Change event procedure to round the input to 2 decimal places, but that would require users to allow macros.
Aug 13 2021 12:34 AM
Aug 13 2021 12:47 AM
Aug 13 2021 12:58 AM - edited Aug 13 2021 12:59 AM
Hans. These are the cells and the amounts. And like in Cell D7, it must not allowed me to put in an amount like 125.248 with 3 decimals. Than it must show an error.
Aug 13 2021 04:51 AM
See the attached sample workbook. Try entering more than 2 decimals in D7, D8 or D9.