How to create an Excel Workbook that Autofilters a table after yesterday's date
- Save the Excel Workbook as a Macro-Enabled Workbook (*.xlsm)
- Click on the Developer Tab
- Click on Macros
- Click on ThisWorkbook
- Put in the following code below
- Close and Re-open the Work-book
Private Sub Workbook_Open()
Dim Filter_Date As String
Filter_Date = Date - 1
ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=1, Criteria1:=">" & Filter_Date, Operator:=xlAnd
End Sub
Private Sub Workbook_Open()
Dim Filter_Date As String
Filter_Date = Date - 1
ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=1, Criteria1:=">" & Filter_Date, Operator:=xlAnd
End Sub
Private Sub Workbook_Open() Dim Filter_Date As String Filter_Date = Date - 1 ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=1, Criteria1:=">" & Filter_Date, Operator:=xlAnd End Sub
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.