Setting filter dates + Times


  • I am using Microsoft Project 2013 and am attempting to set filters for Dates + Times for printing.

    The Dayshift dates arent an issue as it only needs the date + time using Today & Tomorrow.

    ' Macro Print_Dates
    ' Macro Recorded 02/07/18 8:15 AM by Willshire, Paul.
        SetAutoFilter FieldName:="Start", FilterType:=pjAutoFilterCustom, Test1:="is greater than", Criteria1:="Today 6:00 AM"
        SetAutoFilter FieldName:="Finish", FilterType:=pjAutoFilterCustom, Test1:="is less than", Criteria1:="Tomorrow 6:00 PM"
    End Sub

    The Nightshift is another issue as I need to go from 6:00 PM + 36 hours which takes it past tomorrow which is causing me to not be able to find code to carry this task out.

    Can anyone assist?

    Senin, 02 Juli 2018 00.38

Semua Balasan

  • Frustrated,

    I'm sorry but I don't quite understand exactly what you are trying to do.

    Are your tasks manually scheduled?

    What exactly is the "Dates + Times"?

    Please explain your Nightshift. Going from 6:00 PM + 36 hours is a whole lot more than just "past tomorrow".


    Senin, 02 Juli 2018 13.17
  • Sorry. I am trying to filter the Start Column to Today at 6:00PM and the Finish Column to Today 6:00 PM Plus 36 hours.


    Selasa, 03 Juli 2018 21.54
  • Frustrated,

    Okay, well that didn't clarify much. Are you trying to filter tasks that start today at 6:00PM and finish 36 hours later? That's a pretty exact time frame and it would be very unusual for any tasks to fit that precise span. What about tasks that happen to start today at 5:00PM? Or how about tasks that have started but finish within the 36 hour window? Or tasks that are scheduled to start in the next 36 hours and may or may not finish in the window?

    I can imagine a lot of different scenarios.


    Rabu, 04 Juli 2018 02.04
  • The reason for the exact timing is we have shutdowns which last for between 4 days and 12 days. They are scheduled in 30 min increments and the shifts start at 6:00 AM and 6:00PM.

    The reason for the 36 hour look ahead is so the supervisors can start preparing for what is coming beyond the current shift.

    The start is not really my issue. I have code for that. Its the 36 hour look ahead which has me stumped.

    Any assistance you can give would be much appreciated.

    Rabu, 04 Juli 2018 20.31
  • Frustrated,

    Remember, you know exactly what you are looking at with your plan, I do not, so you need to think in terms of explaining what you are trying to do as if I were an independent observer coming in cold, which I am.

    Is your plan auto-scheduled?

    What is your project calendar?

    Again, are you looking for a filter that starts "today" and looks out 36 hours? And what about tasks that overlap the end points (i.e. start before today but finish within the 36 hour window or start within the 36 hour window but finish after the 36 hour window).

    Since we are still not quite "on the same page" a visual example would likely be very helpful.


    Rabu, 04 Juli 2018 21.04
  • Frustrated,

    Let's see if we can cut to the chase with some assumptions on my part. Hopefully it answers your question fully or at least gets you headed in the right direction.

    I assume you want to use VBA so you don't have to manually select the auto-filter for two separate fields. In that case I would not use an auto-filter at all but rather a normal custom filter that sets criteria for both Start and Finish fields at once.

    One of the problems with using an auto-filter is that the criteria is limited and you cannot directly use a "finish + 36 hours" as a criteria. You can however, use an extra finish field (e.g. Finish1) with a custom field formula that creates a date and time that is a defined interval away from the Finish field. Assuming your "shifts" cover a full 24 hour day (shift 1 = 6:00AM to 6:00PM and shift 2 = 6:00PM to 6:00AM) then the following custom field formula should do what you want:

    Finish1 = DateAdd("h",36,[Finish])

    Hope this helps.


    Kamis, 05 Juli 2018 14.51