ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Want to auto filter with date on daily basis (https://www.excelbanter.com/excel-programming/413117-want-auto-filter-date-daily-basis.html)

Arvind Mahto

Want to auto filter with date on daily basis
 
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

Bob Phillips[_3_]

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




Arvind Mahto

Want to auto filter with date on daily basis
 
A Great thanks it worked.

"Bob Phillips" wrote:

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






All times are GMT +1. The time now is 08:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com