5.12.2024

How to create an Excel Workbook that Autofilters a table after yesterday's date

 How to create an Excel Workbook that Autofilters a table after yesterday's date

  1. Save the Excel Workbook as a Macro-Enabled Workbook (*.xlsm)
  2. Click on the Developer Tab
  3. Click on Macros
  4. Click on ThisWorkbook
  5. Put in the following code below
  6. 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.