+ Reply to Thread
Results 1 to 8 of 8

Extract Data from a table based on a selection from a drop down list (VBA)

  1. #1
    Registered User
    Join Date
    07-19-2017
    Location
    Pune, India
    MS-Off Ver
    office 2016
    Posts
    4

    Extract Data from a table based on a selection from a drop down list (VBA)

    Hi all,
    I have a sheet which contains a master data, i want to copy the data from the master sheet to a new sheet based on the selection made in the drop down list.
    I tried using slicer but it does not suit my needs, so i made my own drop down list in Cell A10 which has all the dates present in column H.
    What i am looking for is, when i select a particular date from the drop down list i want the data from all the rows containing that date to be displayed in the "Output" sheet.
    I tried doing it through formulae but as the data is in 1000's of cells the output is very slow to load ,so i would like to know a VBA code which does the same.
    Any help will be appreciated.

    Regards,
    Shantanu

    For your reference i have attached a test sheet.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Extract Data from a table based on a selection from a drop down list (VBA)

    Why not a filter on H12 in the original data?
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: Extract Data from a table based on a selection from a drop down list (VBA)

    Hello Shantanu,

    Try the following code assigned to a button:-

    Please Login or Register  to view this content.
    I hope that this helps.

    Cheerio,
    vcoolio.

  4. #4
    Registered User
    Join Date
    07-19-2017
    Location
    Pune, India
    MS-Off Ver
    office 2016
    Posts
    4

    Re: Extract Data from a table based on a selection from a drop down list (VBA)

    Hi oeldere,
    Filtering the data wont work for my problem because i also need the data to be displayed in another sheet.

  5. #5
    Registered User
    Join Date
    07-19-2017
    Location
    Pune, India
    MS-Off Ver
    office 2016
    Posts
    4

    Re: Extract Data from a table based on a selection from a drop down list (VBA)

    Quote Originally Posted by vcoolio View Post
    Hello Shantanu,

    Try the following code assigned to a button:-

    Please Login or Register  to view this content.
    I hope that this helps.

    Cheerio,
    vcoolio.
    Hi vcoolio,
    That is 99% of what i am looking for. THANK YOU! The only issue that is still present is that when i click the button the data is being extracted below the previous data, whereas i want the data in the "output" sheet to show the data of only the date i select. For your reference, i have attached the sheet after assigning the macro to the button and using it.
    If the sheet only shows the output i want and deletes the previous output then it would be perfect.
    Thank you for your effort and prompt response!

    Regards,
    Shantanu
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: Extract Data from a table based on a selection from a drop down list (VBA)

    Hello Shantanu,

    Add this line of code:-

    Please Login or Register  to view this content.
    just above

    With Sheet1...............

    You should then be able to refresh the Output sheet with just the new data.

    I hope that this helps.

    Cheerio,
    vcoolio.

  7. #7
    Registered User
    Join Date
    07-19-2017
    Location
    Pune, India
    MS-Off Ver
    office 2016
    Posts
    4

    Re: Extract Data from a table based on a selection from a drop down list (VBA)

    Quote Originally Posted by vcoolio View Post
    Hello Shantanu,

    Add this line of code:-

    Please Login or Register  to view this content.
    just above

    With Sheet1...............

    You should then be able to refresh the Output sheet with just the new data.

    I hope that this helps.

    Cheerio,
    vcoolio.
    Hello vcoolio,
    Thanks Alot! Worked exactly as i wanted!! :D

  8. #8
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: Extract Data from a table based on a selection from a drop down list (VBA)

    You're welcome Shantanu. I'm glad to have been able to assist.

    Thanks for the rep.

    Cheerio,
    vcoolio.

+ 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. View Table based on drop down list selection
    By wiseguy00 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-21-2018, 06:58 AM
  2. Replies: 10
    Last Post: 04-03-2018, 02:27 PM
  3. Extract data from one worksheet to another based on selection in drop-down menu
    By deathrowdreams in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-22-2017, 08:52 AM
  4. [SOLVED] VBA to Amend the Filter Selection on a Pivot Table Based on a Drop Down List
    By The_Snook in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-22-2017, 10:00 AM
  5. Replies: 2
    Last Post: 12-10-2014, 12:42 AM
  6. Replies: 2
    Last Post: 07-15-2014, 08:24 PM
  7. Copy row data based on drop down list selection
    By Tom in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-21-2006, 11:55 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