Good evening everyone,
I have 4 worksheets:
Sheet1
Sheet2
Sheet3
Sheet4
I would like to know if there is a VBA Macro at the time of opening does the "Reapply All" filter (Filter) of all worksheets work?
Thanks for your help.
Good evening everyone,
I have 4 worksheets:
Sheet1
Sheet2
Sheet3
Sheet4
I would like to know if there is a VBA Macro at the time of opening does the "Reapply All" filter (Filter) of all worksheets work?
Thanks for your help.
Your question is pretty open with assumptions. But You can use this to get you started. Copy this to your Personal Macro and work this till you get what you want then you can move it to a WorkBook Open event.
This code assumes that you always want to apply filters to the 1st row of all the worksheets in your book.
Good evening Fuzz-Head,
Thanks for the answer, but I have a doubt but the code, where should I put?
Should I put "This Workbook" or VBA of Sheet1-2-3-4?
Have a good evening
The code needs to be placed in the WorkBook Open event - Where to put the code
Private Sub Workbook_Open()
Dim oWs As Worksheet
For Each oWs In Worksheets ''///check for AutoFilter, if not in use apply
If Not oWs.AutoFilterMode Then oWs.Range("A1").AutoFilter
Next oWs
End Sub
You could Use Tables to make it easier to identify the data.
This code uses Tables and you do not need to know the address of the Table
Good morning royUK,
does not work,
I am attaching the file, so you can see if I was wrong.
Thanks and best regards
You have two WorkBook Open events, you can only have one of each event.
You are using the code for Tables but haven't converted your data to Tables.
Try this, I'm not sure what your Tester codes are for
Dear royUK,
Not good, I'll explain the same:
-Sheet "Mese Corrente" use the filter column D from the oldest up to today's date;
-Sheet "Mese successivo" use the filter column D from the oldest up to the date of the following month only;
-Sheet "2 Mesi successivi" use the filter column D from the oldest up to the date only 2 months later;
- "Generale" sheet use the filter column D from the oldest to the most recent;
-Sheet "Da incollare" use the filter column D from the oldest to the most recent.
Thanks
QuoteI would like to know if there is a VBA Macro at the time of opening does the "Reapply All" filter (Filter) of all worksheets work?
Your last comment is not the same!
Don’t have an account yet? Register yourself now and be a part of our community!