Want to auto filter with date on daily basis

A

Arvind Mahto

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").Select
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
 
A

Arvind Mahto

A Great thanks it worked.

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


--
__________________________________
HTH

Bob
 

Ask a Question

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. After that, you can post your question and our members will help you out.

Ask a Question

Top