+ Reply to Thread
Results 1 to 5 of 5

Import data range based on specific criteria

  1. #1
    Registered User
    Join Date
    09-26-2009
    Location
    ontario canada
    MS-Off Ver
    Excel 2003
    Posts
    64

    Import data range based on specific criteria

    I would like to automatically import data into a work week schedule template from a data work sheet using specific criteria. For example; I would need to import all rows that meet the folling criteria a) Contain MCAW or MCSH or MMSH as the crew, b) Has T-12 in the T-Week column and c) Has a scheduled start date of Monday Nov 16/2009. All rows meeting this criteria would be imported into the "Work Schedule" on the appropriate day. Also, only information contained in row cells A to P is required.
    I do not even know where to start on this one but if it can be done my life would be much easier!
    Attached Files Attached Files
    Last edited by pdmkh; 10-04-2009 at 12:50 PM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Import data range based on specific critria

    Please see the attached workbook:
    wrk shedule(daily tab).xls
    You will have to modify the macro with the location/path of your data file at this line:
    Please Login or Register  to view this content.
    Last edited by protonLeah; 10-05-2009 at 12:27 AM.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    09-26-2009
    Location
    ontario canada
    MS-Off Ver
    Excel 2003
    Posts
    64

    Re: Import data range based on specific criteria

    First of all, thank you for your response. I can see that this is possible. I have changed the woorbook address in the macro and it opened everything the way it should but I am getting another error for the "S DATE":

    For Each TestCell In SheetData
    ' get the record test values
    S_DATE = DateValue(TestCell.Offset(0, 8).Value)
    CREW = TestCell.Offset(0, 15).Value
    T_WEEK = TestCell.Offset(0, 16).Value

  4. #4
    Registered User
    Join Date
    09-26-2009
    Location
    ontario canada
    MS-Off Ver
    Excel 2003
    Posts
    64

    Re: Import data range based on specific criteria

    The "S DATE" issue is only a problem when I try to open a work book that has a macro that runs upon opening. When I use the sample template that basically has the same format there is no issue, any ideas??. Also, I removed the code that has the data copied to another sheet as I need the data to load into the appropriate space in the template. How do I import data in for Tuesday and Wednesday etc. Where in your code does the color change for the offsetting rows occur. I know there are numerous questions here for which I apologize but your help has me closer to resolving this issue then I have ever been before. Not bad for one day, thanks again

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Import data range based on specific criteria

    Here's the latest mod. The code lines:
    Please Login or Register  to view this content.
    in the ScheduleMaker module must be modified with your file location & name

    This is basically just Autofilter with some copy and paste...wrk shedule(bvj 2).xls

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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