+ Reply to Thread
Results 1 to 11 of 11

How to make a cell accept only a list of numbers, and not words.

Hybrid View

  1. #1
    Registered User
    Join Date
    10-11-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007
    Posts
    53

    How to make a cell accept only a list of numbers, and not words.

    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.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: How to make a cell accept only a list of numbers, and not words.

    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

  3. #3
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: How to make a cell accept only a list of numbers, and not words.

    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

  4. #4
    Registered User
    Join Date
    10-11-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: How to make a cell accept only a list of numbers, and not words.

    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)

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: How to make a cell accept only a list of numbers, and not words.

    see the attached. i have created 2 different DV's based on what i said above. let me know how that works for you
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    10-11-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: How to make a cell accept only a list of numbers, and not words.

    I don't see anything attached.

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: How to make a cell accept only a list of numbers, and not words.

    sorry, forgot to attach, check again

  8. #8
    Registered User
    Join Date
    10-11-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: How to make a cell accept only a list of numbers, and not words.

    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.

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: How to make a cell accept only a list of numbers, and not words.

    you could add all the possible combinations to the list (i know, a pain), and then increase the list range?

  10. #10
    Registered User
    Join Date
    10-11-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: How to make a cell accept only a list of numbers, and not words.

    I thought of that too. It's not really worth it. Thank you so much for your help though!

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: How to make a cell accept only a list of numbers, and not words.

    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.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1