How to make a cell accept only a list of numbers, and not words. For example, I want cells C9,C18,C27,G9,G18 of Sheet1, accept only a list of number (e.g. "1-4, 6", or, "1, 2, 3, 4, 6").
Thanks!
How to make a cell accept only a list of numbers, and not words. For example, I want cells C9,C18,C27,G9,G18 of Sheet1, accept only a list of number (e.g. "1-4, 6", or, "1, 2, 3, 4, 6").
Thanks!
Last edited by FDibbins; 10-19-2012 at 11:14 AM.
easiest way to do this is with data validation. find it in the data tab, you can either set it up as a list, or as whole numbers with a min/max
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
denisirio,
Have a look at using Data Validation. Here are some links to get you started:
http://office.microsoft.com/en-us/ex...010072600.aspx
http://office.microsoft.com/en-us/ex...001034657.aspx
http://www.contextures.com/xlDataVal01.html
Hope that helps,
~tigeravatar
Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble
Thank you for your quick responses.
However, I tried data validation. It only allows me to put a single number in one cell. I want to be able to put something like "1,2,5,8" or "1-4, 6, 8" (the numbers would be the piece numbers of a specific project, and a cell should require a list of whole numbers, not just one)
see the attached. i have created 2 different DV's based on what i said above. let me know how that works for you
I don't see anything attached.
sorry, forgot to attach, check again
I see it. Thanks!
However, I want the users to be able to enter something like: "1, 2, 5-8" If I try to enter that in either one of your examples it won't work.
The reason I'm doing this is because the users take shortcuts by writing in words, while I'm trying to have them avoid that method, and instead use piece numbers like: 1, 2, 5, 8.
I tried every DV possible and I get the feeling that only a macro will be able to solve this.
you could add all the possible combinations to the list (i know, a pain), and then increase the list range?
I thought of that too. It's not really worth it.Thank you so much for your help though!
Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
Thanks.
Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks