+ Reply to Thread
Results 1 to 7 of 7

Validate comma-separated list of values

  1. #1
    Registered User
    Join Date
    04-21-2013
    Location
    Bremen
    MS-Off Ver
    Excel 2010
    Posts
    3

    Validate comma-separated list of values

    I am already working on this for quite a few hours. Since I assume it to be a standard use case, I would like to ask for the help of the forum to give me a hint…

    I have a list of “allowed values” in a given range on my worksheet.

    I would like to use the Data Validation function to guarantee, that a certain cell contains a comma-separated list containing only values from this list.

    In an example:
    Cells with allowed values contain: “Val1”, “Val2”, “Val3”, … (each value in a separate cell, let’s say A1:A3).
    The data validation should allow the value “Val1; Val3” but not “Val2; Val4; Val3”.
    I already did some macro writing (using the Split+Trim function), but wasn’t successful in the end. Furthermore, it seems a bit of an “overkill” in my eyes… Isn’t there an easier way to realize this that does not require the use of macros?

    Many thanks and best regards,
    Dominik

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Validate comma-separated list of values

    It is hard to understand what you are trying to do?
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Validate comma-separated list of values

    attach a sample file with your macros and show better the final result you want
    If solved remember to mark Thread as solved

  4. #4
    Registered User
    Join Date
    04-21-2013
    Location
    Bremen
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Validate comma-separated list of values

    Sorry if my description wasn't fully understandable.

    Please notice the attached Excel file. It contains a list of possible values in the left-hand side and a set of cells with comma-separated entries (like "V1,V2,V3") to be validated.
    I used the following small VBA snippet to do the job:

    Please Login or Register  to view this content.
    Using this formula in a second column and referencing its value in the "data validation/custom"-formula does the job. Still it requires VBA macros which I would like to avoid.
    Isn't there some kind of clever "array formula" or such that unfolds the comma-separated string and does the item-by-item-validation in one nice formula?

    Many thanks and best regards
    Dominik
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Validate comma-separated list of values

    you don't like macros ? or does macro not work properly ?

  6. #6
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Validate comma-separated list of values

    Works fine for me. And I don't see why you would need anything else?

  7. #7
    Registered User
    Join Date
    04-21-2013
    Location
    Bremen
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Validate comma-separated list of values

    The only thing that bothers me is the necessity for activating VBA macros. I would prefer to have some kind of formula that does not require VBA.
    Anyone sees any possibility?

+ 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