+ Reply to Thread
Results 1 to 19 of 19

Multiple Data Validation entries into one cell

  1. #1
    Registered User
    Join Date
    05-02-2014
    Location
    Portage, Indiana
    MS-Off Ver
    Office 2010
    Posts
    27

    Multiple Data Validation entries into one cell

    Is it possible to create a formula using a Data Validation List where it will add a new entry to the existing entries in a cell?
    For example: I have a data validation list with the names of Pete, Chris, Bruce, Carly, Megan, and Becky. With the normal data validation set I can select one entry and it will be output into the designated cell. If I select Bruce then Bruce with be placed in the cell. Is it possible to set it up so that each time I click on data validation it will add an entry to the already existing entry? E.g. I have already selected Bruce then I decide to add Becky, I want the output cell to show both Bruce and Becky.

    I know I can do this with a formula that will place all the results from different cells into a single cell, but I would then have to create multiple data validation entries of which I would rather avoid if possible. Not to mention I don't remember how to do this formula anyway......

    Bruce

  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
    52,929

    Re: Multiple Data Validation entries into one cell

    The whole point of DV is to have a specified list and to stick WITH that list - and to make sure that users ONLY use items in that list. From the sounds of it, what you want to do, you might just as well not even use DV. What would the difference be in having Peter already in the list and then someone mis-typed Petre - compared to you wanting to add a new name Petre?
    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
    Registered User
    Join Date
    05-02-2014
    Location
    Portage, Indiana
    MS-Off Ver
    Office 2010
    Posts
    27

    Re: Multiple Data Validation entries into one cell

    Quote Originally Posted by FDibbins View Post
    The whole point of DV is to have a specified list and to stick WITH that list - and to make sure that users ONLY use items in that list. From the sounds of it, what you want to do, you might just as well not even use DV. What would the difference be in having Peter already in the list and then someone mis-typed Petre - compared to you wanting to add a new name Petre?
    Exactly! I want whomever is using this spreadsheet to stick with the specified list in the spreadsheet to make sure they only use the items/names in that list.
    I use Data Validation: List, which creates a drop down list of the possible entries that have already been typed in. So there is no typing is needed as it is all selected from the drop down list. You can of course start typing and the list will auto fill for you as needed. If there is another way to do this, then how? I was directed to data validation when I was looking for drop down lists. If I can figure this out it will be used for more than just names, one of the lists has over 250 entries.

    Bruce

  4. #4
    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
    52,929

    Re: Multiple Data Validation entries into one cell

    OK, so based on post # 3, what exactly is your question?

  5. #5
    Registered User
    Join Date
    05-02-2014
    Location
    Portage, Indiana
    MS-Off Ver
    Office 2010
    Posts
    27

    Re: Multiple Data Validation entries into one cell

    Ummm, it's in my first post.
    Here it is again: Is it possible to create a formula using a Data Validation List where it will add a new entry to the existing entries in a cell?
    For example: I have a data validation list with the names of Pete, Chris, Bruce, Carly, Megan, and Becky. With the normal data validation set I can select one entry and it will be output into the designated cell. If I select Bruce then Bruce with be placed in the cell. Is it possible to set it up so that each time I click on data validation it will add an entry to the already existing entry? E.g. I have already selected Bruce then I decide to add Becky, I want the output cell to show both Bruce and Becky.
    Basically I want to have it set up so each time I click on a name or item in the Data Validation List, it will add what I click on to what is already in the existing cell.

    Bruce

  6. #6
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Multiple Data Validation entries into one cell

    If I understood your requirement correctly, I think that you can achieve this with the help of a VBA code. Please find the attached sheet to see an example and let me know if this is what you are trying to achieve.
    Attached Files Attached Files
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  7. #7
    Registered User
    Join Date
    05-02-2014
    Location
    Portage, Indiana
    MS-Off Ver
    Office 2010
    Posts
    27

    Re: Multiple Data Validation entries into one cell

    Yes that is exactly what I am trying to do. I would look at the VBA code to see what you did but I have no idea how to do that in this version of Excel.

    Bruce

    Edit: But I found little problem. Once I enter in a name I am unable to clear it out if I need to.
    2nd Edit: Ok, I was able to get the Developer tab to show and now that I have looked at your code, I have no idea how to decipher that.....to get it to work for me.
    Last edited by Madmaxneo; 06-02-2014 at 10:31 PM.

  8. #8
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Multiple Data Validation entries into one cell

    The Code has been corrected as per your requirement. i.e. now you can clear a name from the cell.
    To view the code, right click on Sheet1 --> View Code.
    Here you will find two codes one for Worksheet_Change Event and another for Worksheet_SelectionChange Event. Both these code contain a line
    Please Login or Register  to view this content.
    This line of code assumes that Col. A contains your drop-down list. If your drop-down list is on another column, please change it in the code. (like if your drop-down list is in col. D, change it to Range("D:D") in the above line of code.
    And this change has to be applied for both worksheet_change and worksheet_selectionchange codes.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    05-02-2014
    Location
    Portage, Indiana
    MS-Off Ver
    Office 2010
    Posts
    27

    Re: Multiple Data Validation entries into one cell

    Cool thanks, I will work on this as soon as I can. I will let you know how it works out.

    Bruce

  10. #10
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Multiple Data Validation entries into one cell

    Sure.....

  11. #11
    Registered User
    Join Date
    05-02-2014
    Location
    Portage, Indiana
    MS-Off Ver
    Office 2010
    Posts
    27

    Re: Multiple Data Validation entries into one cell

    One more question before I retire for the night. How do I use this same code for different lists? I know I need to change the reference cells of the VBL code, but how do I use this same code more than once on the same sheet? Would I just add the other ranges to the code as is like this:
    Please Login or Register  to view this content.
    ?

    Bruce

  12. #12
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Multiple Data Validation entries into one cell

    See the attached sheet.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    05-02-2014
    Location
    Portage, Indiana
    MS-Off Ver
    Office 2010
    Posts
    27

    Re: Multiple Data Validation entries into one cell

    It seems to be working so far except for 2 problems.
    1. When I start adding values to a cell the macro puts a "0," as the first entry.
    2. This is more of a slight annoyance and can possibly live with; I have to clear the entire cell contents and start over if I need to change one value, as it will not let me delete only one value.
    Thanks for the great help!
    Bruce

  14. #14
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Multiple Data Validation entries into one cell

    You're welcome.

  15. #15
    Registered User
    Join Date
    05-02-2014
    Location
    Portage, Indiana
    MS-Off Ver
    Office 2010
    Posts
    27

    Re: Multiple Data Validation entries into one cell

    Is there any way of removing the "0," that shows up when I start adding values to the cell with your macro tied to it?
    Bruce

  16. #16
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Multiple Data Validation entries into one cell

    Please upload a sample workbook with the code applied and showing the problem in the sheet itself. Let me see if I can assist further.

  17. #17
    Registered User
    Join Date
    05-02-2014
    Location
    Portage, Indiana
    MS-Off Ver
    Office 2010
    Posts
    27

    Re: Multiple Data Validation entries into one cell

    Finding other problems also. This is of course using the macro you wrote for me with the data validation list function. When I add a few items to the cell to test it out and then "clear contents", it clears them just fine. But, when I go back and add names to the cell the ones I originally put in there and cleared out return. It seems the only way to stop this is to "clear contents", un-merge the cells and then re-merge them. Then everything is cleared. I can also keep it cleared if I "Clear Contents" then save the document and re-open it.

    Oddly enough the "0," problem I had earlier is gone....
    I wonder, would these issues have something to do with the multitude of formulas I am using? Or could this be similar to a problem Excel had way back in the day (10+ years ago) with random odd formula errors?

    Bruce

    EDIT: I just checked for updates to MS office and there are no new updates for me.
    Last edited by Madmaxneo; 06-05-2014 at 01:23 AM.

  18. #18
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Multiple Data Validation entries into one cell

    See if you can clear content of a cell now.
    Attached Files Attached Files

  19. #19
    Registered User
    Join Date
    05-02-2014
    Location
    Portage, Indiana
    MS-Off Ver
    Office 2010
    Posts
    27

    Re: Multiple Data Validation entries into one cell

    More problems with that macro I recently noticed, and it goes all the way back to the last one before the multiple values one (I didn't check the previous ones).
    The problems:
    1. I still have to close the spreadsheet and re-open it to clear out the old values that I don't want.
    2. If I close the sheet when I am finished with it and re-open it later and then try and add in new values into the data validation cells it will clear the list completely so I have to enter in all the values again.

    Questions:
    A. Is there a way to program the VBA code to not delete the values unless I manually delete them, and to keep adding values when I add new ones without deleting the old ones?

    B. Is it possible to program the VBA code to delete a value I choose if the value is already in the Data Validation cell? I.e. if "Marcus" is already in the DV cell and I pick "Marcus" again in the dropdown list it will delete "Marcus" from the list entirely until I choose to add "Marcus" again.

    Bruce

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Data Validation: Remove only one entry of multiple entries in list
    By elmerg in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-13-2013, 04:45 PM
  2. Select Multiple Entries Data Validation - Linked to Charts
    By bp2010 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-22-2012, 08:56 PM
  3. Multiple entries in Data Validation
    By rekussu in forum Excel General
    Replies: 2
    Last Post: 08-04-2011, 03:33 AM
  4. Replies: 3
    Last Post: 10-18-2010, 11:09 AM
  5. Excel 2007 : Data validation; multiple entries
    By adilad in forum Excel General
    Replies: 1
    Last Post: 06-27-2009, 04:16 AM

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