+ Reply to Thread
Results 1 to 7 of 7

Macro to loop through drop down list and copy data to new sheet

  1. #1
    Registered User
    Join Date
    01-27-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Macro to loop through drop down list and copy data to new sheet

    I have a dashboard set up in which when you choose a doctor from the drop down menu (created with data validation list) in cell B2, a score is generated for the doctor in cell D20.

    I would like to be able to automatically call up each doctor in the drop down menu and copy the provider name and their score into a new sheet. So, the columns in the new sheet would be labeled Provider (in cell A1) and Score (in cell B1). Each row would contain a provider from the drop down menu and their corresponding score.

    Is there a way to do this?

    Here is a link to a test sheet: https://www.dropbox.com/s/blo55eub9n...le_012814.xlsx

    The "provider performance" tab is the dashboard that includes the drop down menu. I want to automatically loop through the drop down menu in B2 and copy and paste the provider ID from the drop down, along with the overall score in cell d20 into the provider id and overall score columns (a1 and b1) in the "provider data" tab.

    The final output would have each of the 7 provider IDs and their scores populating the provider data tab from a2 to b8.

    Thanks in advance!

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

    Re: Macro to loop through drop down list and copy data to new sheet

    I'm not sure if I correctly interpreted what you want to do. Copy and paste this macro into the worksheet code module. Do the following: right click the tab for your sheet "Provider Performance" and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Make a selection in cell B2 and the ID and Score will be copied to the other sheet. You should format column A in the "Provider Data" sheet as a number with no decimal places.
    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.

  3. #3
    Registered User
    Join Date
    01-27-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Macro to loop through drop down list and copy data to new sheet

    Quote Originally Posted by Mumps1 View Post
    I'm not sure if I correctly interpreted what you want to do. Copy and paste this macro into the worksheet code module. Do the following: right click the tab for your sheet "Provider Performance" and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Make a selection in cell B2 and the ID and Score will be copied to the other sheet. You should format column A in the "Provider Data" sheet as a number with no decimal places.
    Please Login or Register  to view this content.

    Thanks, that is definitely getting closer then I did! I want it to copy and paste into the new tab, just as it is doing. However, I'd like to not have to select the provider from the drop down list. The actual data set will include thousands of providers, and I need it to loop through the drop down list automatically instead of having to manually select the next one in the list. Any thoughts on how to do that?

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Macro to loop through drop down list and copy data to new sheet

    Try this code:

    Please Login or Register  to view this content.

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

    Re: Macro to loop through drop down list and copy data to new sheet

    Put this macro into a regular module and run it. Is this what you were looking for?
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-27-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Macro to loop through drop down list and copy data to new sheet

    Quote Originally Posted by Mumps1 View Post
    Put this macro into a regular module and run it. Is this what you were looking for?
    Please Login or Register  to view this content.
    Yes, perfect, THANK YOU!

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

    Re: Macro to loop through drop down list and copy data to new sheet

    My pleasure.

+ 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] Run a loop to slected data then filter on another sheet and copy to another sheet
    By af_lel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-21-2013, 07:10 AM
  2. [SOLVED] need a macro to loop thru names in a drop down list for a timesheet
    By radarzdc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-20-2012, 02:47 AM
  3. Help making a copy paste Macro for data from drop down list
    By sleep in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-08-2012, 05:21 AM
  4. [SOLVED] Macro to create multiple sheet, copy certain values and loop until end of row data
    By jhoelski in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 02-17-2012, 07:35 AM
  5. Replies: 1
    Last Post: 04-28-2008, 03:30 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