Hi
Looking for some help, I have a workbook with several tables across several worksheets that I want to be able to set all tables to exclude the current months data. I can obviously manually go through each worksheet but is tiresome as I have to regularly switch between 'to date' data and 'to last month' data
I have a 'remove all filters' vba as below, but cannot work out how to modify to suit. Any help would be appreciated, thank you.
Sub Remove_Filters()
Dim xAF As AutoFilter
Dim xFs As Filters
Dim xLos As ListObjects
Dim xLo As ListObject
Dim xRg As Range
Dim xWs As Worksheet
Dim xIntC, xF1, xF2, xCount As Integer
Application.ScreenUpdating = False
On Error Resume Next
For Each xWs In Application.Worksheets
xWs.ShowAllData
Set xLos = xWs.ListObjects
xCount = xLos.Count
For xF1 = 1 To xCount
Set xLo = xLos.Item(xF1)
Set xRg = xLo.Range
xIntC = xRg.Columns.Count
For xF2 = 1 To xIntC
xLo.Range.AutoFilter Field:=xF2
Next
Next
Next
Application.ScreenUpdating = True
End Sub
Bookmarks