+ Reply to Thread
Results 1 to 14 of 14

Data validation list with two columns and one output

  1. #1
    Forum Contributor
    Join Date
    03-16-2009
    Location
    NC
    MS-Off Ver
    Office 2016
    Posts
    164

    Data validation list with two columns and one output

    Hello all,

    I am trying to create a drop down list, using data validation, from sheet "parts". The data is in columns A and B. On the dropdown, which is located in sheet "entry", I need to see the part number and the name of the part. Once selected, the output has to be only the part number.

    How do I go about doing that? I have attached a sample workbook.

    Thank you in advance.
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Data validation list with two columns and one output

    Hi sentinela,

    You can only have a single column in a Validation list but there might be a way to show two parts of the data: Read:
    https://contexturesblog.com/archives...rop-down-list/

    Let us know if you get this to work for you. It is a little tricky as you need to add the combo box to the spreadsheet and while in design mode set its properties.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,844

    Re: Data validation list with two columns and one output

    Copy and paste this macro into the worksheet code module. Do the following: right click the tab name for your Entry sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Change the line in red to suit your needs. Close the code window to return to your sheet. Make a selection in B2. The macro assumes that the part number will always be 4 digits.
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  4. #4
    Forum Contributor
    Join Date
    03-16-2009
    Location
    NC
    MS-Off Ver
    Office 2016
    Posts
    164

    Re: Data validation list with two columns and one output

    Thanks for the reply.

    The problem that I am kind of running into is that my other code refers to the result. I have not been able to refer to a combobox.

    Please Login or Register  to view this content.
    Being that "EmpID" is the result from the dropdown.

  5. #5
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,844

    Re: Data validation list with two columns and one output

    The macro I suggested works in the file you posted. It would be easier to help and test possible solutions if you could attach a copy of your actual file. Explain in detail what you want to do referring to specific cells, rows, columns and sheets using a few examples from your data (de-sensitized if necessary).

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Data validation list with two columns and one output

    Hi sentinela,

    Mumps isn't using a combo box. He is using a Validation box but showing what is in your range on the parts sheet. A very clever work-a-round.

  7. #7
    Forum Contributor
    Join Date
    03-16-2009
    Location
    NC
    MS-Off Ver
    Office 2016
    Posts
    164

    Re: Data validation list with two columns and one output

    Quote Originally Posted by Mumps1 View Post
    The macro I suggested works in the file you posted. It would be easier to help and test possible solutions if you could attach a copy of your actual file. Explain in detail what you want to do referring to specific cells, rows, columns and sheets using a few examples from your data (de-sensitized if necessary).
    Thank you very much for the help.

    Your idea worked. However, I have another problem at hand. I have posted the actual workbook in this thread

    https://www.excelforum.com/excel-pro...o-another.html

    Thanks again.

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,844

    Re: Data validation list with two columns and one output

    Try:
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    03-16-2009
    Location
    NC
    MS-Off Ver
    Office 2016
    Posts
    164

    Re: Data validation list with two columns and one output

    It works perfectly

    Thanks.

  10. #10
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,844

    Re: Data validation list with two columns and one output

    You are very welcome.

  11. #11
    Forum Contributor
    Join Date
    03-16-2009
    Location
    NC
    MS-Off Ver
    Office 2016
    Posts
    164

    Re: Data validation list with two columns and one output

    One other quick question.

    If I have more columns in sheet2 (columns 10 thru 17) that I want to display in sheet1 from range c10 thru c17... How can I adjust the code to do that. I tried couple different things to no avail

    Please Login or Register  to view this content.
    Your thoughts?


    Thank you

  12. #12
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,844

    Re: Data validation list with two columns and one output

    Pease attach an updated copy of your file with the additional columns and explain in detail what you want to copy.

  13. #13
    Forum Contributor
    Join Date
    03-16-2009
    Location
    NC
    MS-Off Ver
    Office 2016
    Posts
    164

    Re: Data validation list with two columns and one output

    I was able to figure it out... It ends up being

    Please Login or Register  to view this content.

  14. #14
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,844

    Re: Data validation list with two columns and one output

    Well done.

+ 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 List looking at two columns
    By pchugh in forum Excel General
    Replies: 4
    Last Post: 05-20-2018, 08:23 PM
  2. [SOLVED] Display columns in excel based on Data validation list in multiple columns
    By tejboyd in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-27-2017, 09:17 PM
  3. [SOLVED] Copy data based on output in a data validation list
    By chubby127 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-12-2015, 11:09 AM
  4. [SOLVED] Sum Cells based on data validation list output
    By gavask in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-23-2013, 03:34 PM
  5. Replies: 10
    Last Post: 11-03-2013, 06:53 PM
  6. Clear cells depending on data validation list output
    By fergcu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-07-2008, 05:11 AM
  7. data validation list from two columns
    By otinky in forum Excel General
    Replies: 1
    Last Post: 03-21-2005, 10:06 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