Hi,
Is it possible to add a data validation to a cell which restricts the user from inputting more than 2 decimal places? I would have thought it would be easy to do but i'm struggling?!?!
Cheers,
Snook
Hi,
Is it possible to add a data validation to a cell which restricts the user from inputting more than 2 decimal places? I would have thought it would be easy to do but i'm struggling?!?!
Cheers,
Snook
Last edited by The_Snook; 12-01-2012 at 05:58 PM.
it seems you cant restrict the number of decimal places with DV. what you could do to overcome this is to reference that cell with a rounddown() or roundup()
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
Try this in custom data validation
![]()
Please Login or Register to view this content.
Life's a spreadsheet, Excel!
Say thanks, Click *
I think you've cracked it Ace_XLNow i've just got to try and get my head around how it works!
FDibbins - Thanks for your suggestion it got me thinking in a different way to a similar problem I had which i've now managed to solve using the ROUND formula.
Rep points all round![]()
we are happy to help, and thanks for the rep![]()
Thanks for the rep
Here is how it works..
In case of a number without decimal points, it allows for any characters
=IF(ISERROR(FIND(".",A1)),LEN(A1)>0
in case it finds a decimal point (the FIND function) the <3 ensures that the number of decimals are less than or equal to 2
One flaw with this would be that it would allow even non-numeric input. Hence a refined verison is as below
![]()
Please Login or Register to view this content.
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
Select Thread Tools-> Mark thread as Solved.
To undo, select Thread Tools-> Mark thread as Unsolved.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks