+ Reply to Thread
Results 1 to 7 of 7

Copy data based on output in a data validation list

  1. #1
    Registered User
    Join Date
    03-11-2013
    Location
    Dubai, UAE
    MS-Off Ver
    Excel 2007
    Posts
    19

    Copy data based on output in a data validation list

    I am looking to copy data to a master list on the same worksheet from a database of names based on the value of a certain cell.

    Please see the attached spreadsheet to follow along.

    Cell C2 contains a list (created from Data Validation) based on the column headers in cells E2:I2.
    I would like this sheet to copy data to cell B5 and below based on the list number that has been selected in cell C2.
    For example, if "List 1" is selected, I should see "John" in cell B5, "David" in cell B6 and so on.

    I left cell I2 as "Manual" in the list in cell B2 as I would like all the names in B5 and below to be cleared so that the user could enter any names manually.

    I've tried my best at doing this by using many IF statements in the macro, but to no avail whatsoever. I'm also sure there is a way to do this using the VBA equivalent of index/match, but I don't have the expertise to do it.

    Any help is immensely appreciated!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Copy data based on output in a data validation list

    Just select the list!! (after enabling the macros)
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    03-11-2013
    Location
    Dubai, UAE
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Copy data based on output in a data validation list

    Hi rcm,

    Many thanks for the quick response.

    All looks good except for two issues:
    - When "Manual" is selected in cell C1, I would like all the names in the list in cells B5 and below to be deleted so that the user can input any names he/she would like to.
    - Assuming the lists are different lengths, I would like ONLY what shows up in the lists to show up in cell B5 and below. In your sheet, for example, if I first select "List 1" and then select "List 2" the additional two names (zz & aaa) still show up as the last two names, even though they aren't in the list.

    Thanks in advance.

  4. #4
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Copy data based on output in a data validation list

    Sorry, its a cleanup bug, I´ll fix it

  5. #5
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Copy data based on output in a data validation list

    Now it clears column B before displaying the selected lists!!
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    03-11-2013
    Location
    Dubai, UAE
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Copy data based on output in a data validation list

    rcm you've been immensely helpful!

    At first I didn't completely understand the macro, but after a bit of tinkering I've managed to understand each line.

    For anyone who faces a similar problem in the future, I've attached is the same file that rcm previously sent, except I have added comments to each line.
    Hopefully any other macro novice like me can understand how rcm has solved my problem.

    Many thanks!
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Copy data based on output in a data validation list

    you are welcome!! please mark the post as solved

+ 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. Replies: 3
    Last Post: 10-09-2014, 02:51 AM
  2. [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
  3. Replies: 10
    Last Post: 11-03-2013, 06:53 PM
  4. Worksheet Change to copy from a sheet based on values from data validation list
    By Onenguyen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-16-2012, 10:23 AM
  5. Replies: 7
    Last Post: 05-09-2012, 04:44 AM
  6. Replies: 3
    Last Post: 04-11-2011, 05:52 PM
  7. 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

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