+ Reply to Thread
Results 1 to 6 of 6

Pull data from one sheet to another based on criteria

  1. #1
    Registered User
    Join Date
    02-09-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    3

    Question Pull data from one sheet to another based on criteria

    March 2013 Test.xlsm

    Hello,

    I would like to be able to pull data from one sheet to another. I have attached a basic data file that has a rota on one tab 'week 2' and a deployment sheet on 7 suceeding worksheets. I would like to pull across the names and shift times of people working in specific areas on that day.

    In esscence, I would like a macro to look up and down 'column E' in 'week 2' and if it contains a given letter i.e. 'R' for restaurant, the data from that row in colums A, B and D is pulled into the 'M' worksheet in the cell range A33:C47. I have manually entered the data into the 'M' sheet for the example. I would like this to run on the press of a button, so not automatically updated.

    Thanks in advance for any help you can provide.

    Mike

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Pull data from one sheet to another based on criteria

    Hi Mike

    I have Code that will work on your Sample File. In your Sample File you have these Dept keys:

    QB
    TB
    TCS
    V
    R

    Are there more...if so what are they? If you don't have more the Code in the attached appears to do as you require. Let me know of issues.
    Attached Files Attached Files
    Last edited by jaslake; 02-11-2013 at 08:18 PM.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    02-09-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Pull data from one sheet to another based on criteria

    Hi Jaslake,

    This works brilliantly. If I was to create a rota for 5 weeks, with 5 sets of daily deployment, could the code be easily duplicated and edited?

    Thanks

    Mike

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Pull data from one sheet to another based on criteria

    Hi Mike

    It could be duplicated...how easily? Don't know...need to see what you have in mind.

  5. #5
    Registered User
    Join Date
    02-09-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Pull data from one sheet to another based on criteria

    In effect, I'd need that set of sheets 5 times, so I could do 5 weeks worth of rota's at once.

    So:

    Week 1
    1 M
    1 T
    1 W
    1 Th
    1 F
    1 Sa
    1 Su
    Week 2
    2 M
    2 T
    2 W
    2 Th
    2 F
    2 Sa
    2 Su

    etc...Would this be a case of me duplicating the 2 modules and changing the sheet references?

    There are also department codes:

    CB, CON, BOH

    Again, thank you for your help

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Pull data from one sheet to another based on criteria

    Hi Mike

    If I understand and my math is correct you'd end up with a workbook with 40 worksheets (the week Master Schedule and a sheet for each day of the week for five weeks). Is this really what you want...seems to me it'll be a bit unwieldy.

    How about a Folder for each month and within that folder you'd have 5 Files, one for each week and within the weekly file you'd have 6 worksheets...the week Master Schedule and a sheet for each day of that week.

    Think about it...get back to me.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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