+ Reply to Thread
Results 1 to 4 of 4

filtering by # of days before (todays date)

  1. #1
    Registered User
    Join Date
    08-09-2012
    Location
    phoenix, az
    MS-Off Ver
    Excel 2010
    Posts
    10

    filtering by # of days before (todays date)

    Is there a way in a macro to filter by # of days prior to todays date? in other words, I have a date column of when a pc last connected. I need to see all of the pc's that last connected before 45 days ago. anything 45 days is ok.

    Manually I would go up to sort/filter, click filter and then the top row would change to where I can filter by date "before". I would have to calculate 45 days ago and then select the date and then it would filter out the pc's.

    so is there a way to say this in macro?

    thanks in advance!

    Chris

  2. #2
    Registered User
    Join Date
    08-09-2012
    Location
    phoenix, az
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: filtering by # of days before (todays date)

    ok I did some research and i found that if you use this formula, I can calculate 45 days back from today.

    =TODAY()-45

    so how can I use this formula to help me filter the rows?

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 2000/3/7/10/13/16
    Posts
    51,807

    Re: filtering by # of days before (todays date)

    why use a macro at all? just add a helper column, add your formula to that column, and then filter on that column
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    08-09-2012
    Location
    phoenix, az
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: filtering by # of days before (todays date)

    I wanted to automate it, thats why I wanted to use a macro. Ultimately I want to filter to get rows that are older than 45 days and then move those rows to another tab.
    If I use a helper column, then I have to automate the insertion of that column, and then delete that column later because the person that receives the reports can only use certain columns and another column could throw off their reports.

    Quote Originally Posted by FDibbins View Post
    why use a macro at all? just add a helper column, add your formula to that column, and then filter on that column

+ 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