+ Reply to Thread
Results 1 to 5 of 5

VBA- Selecting multiple items separated by comma

  1. #1
    Forum Contributor
    Join Date
    10-26-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2010
    Posts
    138

    VBA- Selecting multiple items separated by comma

    Hi, I wanted to make a box list with multiple items showing in the same cell but separated by comma. Please advise how to do the following:

    1) Revise the code in the attached worksheet so that it will link to the selection located in Tab Sheet2 Column C.
    2) Selection is on the same cell separated by comma.
    3) No error message or accept input when the data is not in the box list.

    Please see attached file.

    This is the code which I have taken from internet and I want it to be incorporated on the above file.

    Please Login or Register  to view this content.
    Thanks & Regards
    Jewel
    Attached Files Attached Files
    Last edited by jewellove; 01-30-2013 at 01:42 AM.

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: VBA- Selecting multiple items separated by comma

    hi Jewel, i changed just this line. basically from the original code where it was 3 to your desired column 2 (Column B).

    Please Login or Register  to view this content.
    press ALT + F11 to go into VBA editor. go to View -> Project Explorer. you should see a window on the top right. double-click Sheet1 & paste the codes

    go to Sheet2 & press CTRL + F3. click on the Named Range NumberList & click on the range below "Refers to". select C2:C12.

    go back to Sheet1 & you then need to select B3:B10. go to Data -> Data Validation -> Allow List -> Source:
    =NumbersList

    save file as xlsm or xls to be able to contain macros. attaching finished eg.

    ps: remember to put code tags
    Attached Files Attached Files
    Last edited by benishiryo; 01-29-2013 at 10:09 AM.

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Contributor
    Join Date
    10-26-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2010
    Posts
    138

    Re: VBA- Selecting multiple items separated by comma

    Hi Benne,

    Why is it that when I go to data validation => allow list => =NumbersList? It says name range can't be found. I did go to Sheet2 & press CTRL + F3.

  4. #4
    Forum Contributor
    Join Date
    10-26-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2010
    Posts
    138

    Re: VBA- Selecting multiple items separated by comma

    Hi, Here is the printscreen of the namerange. I notice it starts with "extract" not "numbers"...
    Attached Images Attached Images

  5. #5
    Forum Contributor
    Join Date
    10-26-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2010
    Posts
    138

    Re: VBA- Selecting multiple items separated by comma

    Benne, Yes, Your advise works. Thanks for the help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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