View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_3_] Bob Phillips[_3_] is offline
external usenet poster
 
Posts: 2,420
Default Want to auto filter with date on daily basis

Selection.AutoFilter Field:=13, Criteria1:=Format(Date,"dd-mmmm-yy")


--
__________________________________
HTH

Bob

"Arvind Mahto" wrote in message
...
Hi all,

Below is the coding through wich i want to extract some data with putting
filter on date i have recorded a macro for that that describes below in
which
i want to set a criteria that pick the data from the current date where i
don't need to change the date going into vb editor it should be changed
automatically on daily basis.

Sub SRT()
'
' SRT Macro
' Macro recorded 6/25/2008 by a_mahto
'
' Keyboard Shortcut: Ctrl+Shift+T
'

ChDir "N:\Miscellaneous\Corporate"
Workbooks.Open Filename:= _
"N:\Miscellaneous\Corporate\Time Tracker Product Team v8.xls",
Password:="Product", UpdateLinks:=3
Selection.AutoFilter Field:=13, Criteria1:="21-June-08"
ActiveWindow.SmallScroll Down:=-3
Range("A1851:B1851").Select
Range(Selection, Selection.End(xlDown)).Select
Range("A1851:B1940,F1851:G1940,J1851:M1940").Selec t
Range("J1851").Activate
Selection.Copy
Windows("SRT Delivery Status.xls").Activate
ActiveSheet.Paste
Rows("385:391").Select
Application.CutCopyMode = False
Selection.Sort Key1:=Range("A385"), Order1:=xlAscending,
Header:=xlGuess _
, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A385").Select
Selection.End(xlDown).Select
ActiveWorkbook.Save
End Sub