LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default Filter macro

I am trying to create a macro that will filter column B which is a listing of
dates from last year, same month. So, for instance this months report
contains dates listed from March 2007. I need to filter for dates that are
less than todays date. So, anything from the 19th of 2007 forward would need
to be deleted. This will change every day. Tomorrow will need the 20th
forward rows deleted. This is what I have from trying to create the macro,
but I need the date to be dynamic. What I have will only select accounts I
specify today, and will only delete the rows I manually selected after the
filter. Can anyone help me with this?

Sub Deletedays()

' Deletefromtodaysdateforward Macro
'
Columns("B:B").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="3/18/2007", Operator:=xlAnd
Rows("189:302").Select
Selection.Delete Shift:=xlUp

End Sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro filter puiuluipui Excel Discussion (Misc queries) 4 September 7th 09 01:18 PM
Filter Macro MEPI Excel Programming 8 May 5th 06 07:09 PM
Need macro to filter, create tab on filter and copy/paste Jen[_11_] Excel Programming 1 May 2nd 06 04:45 PM
Need macro to filter, create tab on filter and copy/paste Jen[_11_] Excel Programming 1 May 2nd 06 04:45 PM
Need a filter macro comotoman Excel Discussion (Misc queries) 0 October 6th 05 09:03 PM


All times are GMT +1. The time now is 02:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"