+ Reply to Thread
Results 1 to 9 of 9

Create a list with data validation for partial text

  1. #1
    Registered User
    Join Date
    06-25-2018
    Location
    Madrid, Spain
    MS-Off Ver
    2013
    Posts
    92

    Create a list with data validation for partial text

    Howdy y'all

    I currently have a table in which I have to choose a certain value from a list using the data validation method. But what I want to do is be able to choose something and type extra information to complement it. See attached file with example

    Example screenshot.PNG
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Create a list with data validation for partial text

    Here's one well-trodden way: https://www.contextures.com/xlDataVal02.html
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    06-25-2018
    Location
    Madrid, Spain
    MS-Off Ver
    2013
    Posts
    92

    Re: Create a list with data validation for partial text

    That wasn't really what I was looking for, let me try to explain differently.

    In case subcontractor is the chosen option, I must be allowed to type something in the same cell and not get an error of "Invalid data". Basically what I need is that the cell validates any Subcontractor*.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Create a list with data validation for partial text

    "BUT, if I choose subcontractor I need to be able to type something to complement it."

    Is too vague. Please give some concrete examples of what you want.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  5. #5
    Registered User
    Join Date
    06-25-2018
    Location
    Madrid, Spain
    MS-Off Ver
    2013
    Posts
    92

    Re: Create a list with data validation for partial text

    It's like in the picture I've posted. I chose "subcontractor" in the data validation cell, and what I need is the possibility to have an end result like the cell right next to it "subcontractor blah"

    EDIT: I've done an example on my original table, I essentially need to be able to do what I have done on the very last cell without getting that error.

    Example 2 screenshot.PNG
    Last edited by NickNunes; 08-17-2018 at 04:18 AM. Reason: Added the photo

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Create a list with data validation for partial text

    Try using this as the data validation formula in E2


    =COUNTIF(E2,"*"&C2&"*")=1

  7. #7
    Registered User
    Join Date
    06-25-2018
    Location
    Madrid, Spain
    MS-Off Ver
    2013
    Posts
    92

    Re: Create a list with data validation for partial text

    Not quite what I need yet, but getting close. In the first photo I need C2 to be like E2. The second photo explains better what I'm looking for

  8. #8
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Create a list with data validation for partial text

    Try this. Worksheet events is used.

    Worksheet_SelectionChange event validates cell C2 with list A1:A3

    When Subcontractor is selected worksheet_Change event deletes validation and changes or addition of text can be done.

    Codes:
    Please Login or Register  to view this content.
    How to paste the code?

    Right click on the worksheet tab.
    View code
    VB window opens
    Paste the code in the window.
    Close the window.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  9. #9
    Registered User
    Join Date
    06-25-2018
    Location
    Madrid, Spain
    MS-Off Ver
    2013
    Posts
    92

    Re: Create a list with data validation for partial text

    When I pasted in my spreadsheet it had a few issues, but I fixed them easily and other than that, this code works like a charm. I'll post my changes as a reference in case anyone else needs something similar:

    Please Login or Register  to view this content.

+ 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. [SOLVED] How to create a data validation list using VBA and a comma delimited list
    By cmorten82 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-14-2018, 07:46 AM
  2. [SOLVED] Typing partial text to result in full text in data validation drop down box
    By jennis7242 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-18-2018, 09:39 PM
  3. Vlookup - create new list from existing list based on partial match
    By unknown_brother in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 05-15-2018, 02:31 AM
  4. Replies: 3
    Last Post: 05-23-2013, 06:23 AM
  5. Replies: 2
    Last Post: 07-17-2012, 01:18 PM
  6. Replies: 4
    Last Post: 02-15-2012, 12:11 PM
  7. Replies: 2
    Last Post: 11-24-2005, 06:20 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