+ Reply to Thread
Results 1 to 7 of 7

Is it possible to show a different value after selecting data the validation list?

  1. #1
    Registered User
    Join Date
    07-27-2018
    Location
    New york
    MS-Off Ver
    Office 2013
    Posts
    12

    Is it possible to show a different value after selecting data the validation list?

    Hello,

    Could someone clarify if it is possible to show a different value in the same cell after selecting an option from the drop down / validation list?

    Data validation list:
    Cell A1: John - Perform customizations
    Cell A2: Rosh - Consolidate activities
    Cell A3: Ruth - Monitor implementation

    If a user selects the first one from the list, I want cell A1 to show a custom value - just the name "John."

    In other words, override cell A1 to show only "John" even though the selected option is "John - Perform customizations."

    Another example: Data validation list
    5
    4
    3

    Expected value in the cell:
    High
    Medium
    Low

    Please let me know if the above example is not clear. I would very much appreciate some suggestions.

    Best,
    Krish

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,673

    Re: Is it possible to show a different value after selecting data the validation list?

    What you are asking to do is a contradiction. Data validation requires that the cell contains only the values in the list, and you are asking for it to contain a value that is not in the list. You could do this with VBA but only if you remove the data validation restriction before updating the content of the cell. Something like this could be done using a multicolumn combobox linked to a cell. See example.
    Attached Files Attached Files
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    07-27-2018
    Location
    New york
    MS-Off Ver
    Office 2013
    Posts
    12

    Re: Is it possible to show a different value after selecting data the validation list?

    Quote Originally Posted by 6StringJazzer View Post
    What you are asking to do is a contradiction. Data validation requires that the cell contains only the values in the list, and you are asking for it to contain a value that is not in the list. You could do this with VBA but only if you remove the data validation restriction before updating the content of the cell. Something like this could be done using a multicolumn combobox linked to a cell. See example.
    Hi, thanks for taking the time to reply with an example. I agree that it is counterintuitive to use the data validation list and replace it with custom values. The goal here is to provide a detailed view to the end user in the drop-down, instead of adding comments, but at the same time time, show only what is relevant for calculation/reporting. Do you have any other suggestions?

  4. #4
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,028

    Re: Is it possible to show a different value after selecting data the validation list?

    Here's an example with vba:
    How to setup:
    1. Create a named range “xDVAL”, Refers to: =Sheet1!$C$2:INDEX(Sheet1!$C:$C, COUNTA(Sheet1!$C:$C), 1)
    2. Create a data validation in A2:A10, choose “Allow > List” then source: =xDVAL
    3. On the Error Alert tab, uncheck mark on "Show error alert after invalid data is entered"
    4. Put this code in sheet1 code module:

    Please Login or Register  to view this content.

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,673

    Re: Is it possible to show a different value after selecting data the validation list?

    I had considered the solution offered by Akuini, but I assumed that an attempt to assign a value that was not in the DV list would fail. Apparently it does not. Nice job.

  6. #6
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,706

    Re: Is it possible to show a different value after selecting data the validation list?

    just for info...

    where the "mask" is text and the underlying value is numeric you can do this using custom formats but, it is not advised as it's not very practical !

    e.g.:
    D1: 5 -- set custom number format to "High"
    D2: 4 -- set custom number format to "Medium"
    D3: 3 -- set custom number format to "Low"

    then, A1 DV list =D1:D3

    when you activate the DV list in A1 you will see the "masked" values (High, Medium & Low) but, when you choose a value you will have the underlying value returned to the cell (i.e. 5, 4 or 3)

  7. #7
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,028

    Re: Is it possible to show a different value after selecting data the validation list?

    Quote Originally Posted by 6StringJazzer View Post
    I had considered the solution offered by Akuini, but I assumed that an attempt to assign a value that was not in the DV list would fail. Apparently it does not. Nice job.
    Thanks for examining my code & also for rep+.

+ 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] Selecting value multiple times from data validation list
    By FloorPlanner in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-12-2020, 10:07 AM
  2. [SOLVED] Need data to show by selecting a category in a drop down list
    By uahmed90 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-21-2015, 01:30 AM
  3. Replies: 2
    Last Post: 10-31-2013, 05:26 PM
  4. vba for selecting names one by one from the drop down list (data validation)
    By jinoob in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-01-2013, 04:36 PM
  5. Replies: 2
    Last Post: 08-01-2013, 07:36 AM
  6. Selecting a value from a dropdown list (data validation) which will populate cells..
    By milkychips in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-09-2012, 09:07 PM
  7. Run Macro when selecting from in-cell list (data validation)
    By 4am in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-08-2010, 04:57 PM

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