Filter between Dates

Discussion in 'Microsoft Excel Programming' started by shriil, Sep 20, 2010.

  1. shriil

    shriil Guest

    I have an excel sheet where I keep track of maintenance jobs done
    throughout the year. The data looks like as mentioned below:

    A1 B1 C1

    Descr Job no Job Date

    AAA 25/1 12/08/10

    BBB 12/2 14/08/10

    CCC 30/2 15/08/10

    DDD 05/3 02/09/10

    .... .... ........

    I would like to run a macro where I will filter out the above range
    between two dates, (i.e I input a Start Date and a End Date) and copy
    the filtered list to a new sheet.

    I normally use the Custom Filter Option for doing the same but it
    would be very helpful if the same can be run with a code.

    Thanks for the help
     
    shriil, Sep 20, 2010
    #1
    1. Advertisements

  2. On Sep 20, 2:27 am, shriil <> wrote:
    > I have an excel sheet where I keep track of maintenance jobs done
    > throughout the year. The data looks like as mentioned below:
    >
    >          A1                 B1               C1
    >
    >        Descr            Job no        Job Date
    >
    >         AAA               25/1           12/08/10
    >
    >         BBB                12/2           14/08/10
    >
    >         CCC                 30/2          15/08/10
    >
    >          DDD               05/3            02/09/10
    >
    >          ....                      ....         ........
    >
    > I would like to run a macro where I will filter out the above range
    > between two dates, (i.e I input a Start Date and a End Date) and copy
    > the filtered list to a new sheet.
    >
    > I normally use the Custom Filter Option for doing the same but it
    > would be very helpful if the same can be run with a code.
    >
    > Thanks for the help


    You could have done wheat I just did. RECORD a macro while doing it.

    Sub Macro3()
    '
    ' Macro3 Macro
    ' Macro recorded 9/20/2010 by Donald B. Guillett
    '

    '
    Selection.AutoFilter Field:=1, Criteria1:=">=8/15/2010",
    Operator:=xlAnd _
    , Criteria2:="<=8/23/2010"
    End Sub
     
    Don Guillett Excel MVP, Sep 20, 2010
    #2
    1. Advertisements

  3. shriil

    shriil Guest

    On Sep 20, 5:10 pm, Don Guillett Excel MVP <>
    wrote:
    > On Sep 20, 2:27 am, shriil <> wrote:
    >
    >
    >
    >
    >
    > > I have an excel sheet where I keep track of maintenance jobs done
    > > throughout the year. The data looks like as mentioned below:

    >
    > >          A1                 B1               C1

    >
    > >        Descr            Job no        Job Date

    >
    > >         AAA               25/1           12/08/10

    >
    > >         BBB                12/2          14/08/10

    >
    > >         CCC                 30/2          15/08/10

    >
    > >          DDD               05/3           02/09/10

    >
    > >          ....                      ....        ........

    >
    > > I would like to run a macro where I will filter out the above range
    > > between two dates, (i.e I input a Start Date and a End Date) and copy
    > > the filtered list to a new sheet.

    >
    > > I normally use the Custom Filter Option for doing the same but it
    > > would be very helpful if the same can be run with a code.

    >
    > > Thanks for the help

    >
    > You could have done wheat I just did. RECORD a macro while doing it.
    >
    > Sub Macro3()
    > '
    > ' Macro3 Macro
    > ' Macro recorded 9/20/2010 by Donald B. Guillett
    > '
    >
    > '
    >     Selection.AutoFilter Field:=1, Criteria1:=">=8/15/2010",
    > Operator:=xlAnd _
    >         , Criteria2:="<=8/23/2010"
    > End Sub- Hide quoted text -
    >
    > - Show quoted text -


    yes.. but what about selecting the specified range , a user form for
    entering start date and end date, and finally outputting the same to
    another desired range
     
    shriil, Sep 20, 2010
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Guest

    convert dates stored as text to dates

    Guest, Dec 5, 2004, in forum: Microsoft Excel Programming
    Replies:
    2
    Views:
    444
    Tom Ogilvy
    Dec 5, 2004
  2. Dominique Feteau

    Filter between dates

    Dominique Feteau, Dec 9, 2004, in forum: Microsoft Excel Programming
    Replies:
    2
    Views:
    279
    Dominique Feteau
    Dec 9, 2004
  3. Guest

    Toggle a range of Julian dates to Gregorian Dates and Back

    Guest, Feb 16, 2005, in forum: Microsoft Excel Programming
    Replies:
    4
    Views:
    562
    Guest
    May 8, 2007
  4. EAB1977

    Converting Text dates into dates

    EAB1977, Jan 20, 2006, in forum: Microsoft Excel Programming
    Replies:
    2
    Views:
    510
    Guest
    Jan 20, 2006
  5. Guest

    InputBox requesting dates between two predefined dates

    Guest, Jan 20, 2006, in forum: Microsoft Excel Programming
    Replies:
    2
    Views:
    301
    JE McGimpsey
    Jan 20, 2006
  6. Guest
    Replies:
    12
    Views:
    291
    Ron de Bruin
    Nov 16, 2006
  7. deaconj999

    How to count dates in a column between 2 dates

    deaconj999, Apr 15, 2007, in forum: Microsoft Excel Programming
    Replies:
    6
    Views:
    324
    merjet
    Apr 15, 2007
  8. Graham Y

    VBA Dates & Cell Dates

    Graham Y, Jul 15, 2008, in forum: Microsoft Excel Programming
    Replies:
    4
    Views:
    428
    Ron Rosenfeld
    Jul 16, 2008
Loading...