hi,
I have a workbook containing several sheets wherein on 4 of the sheets there is one identical column that we need to filter by.
I have the following code below. I've tested this code and it works - but only if ALL the sheets have the same identical columns. Like I said above, we have 3 sheets that contain completely different information. How can I modify the code below to make this work? Also, I have hardcoded the criteria. I would like it to be so that when a user uses the autofilter on column1, the criteria gets set to it.
Sub Test()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Range("A2").CurrentRegion.AutoFilter Field:=1, Criteria1:="03-00018-20-107-B-02-00-303-C"
Next
End Sub
Thank you so very much in advance.
Any help or push in the right direction is appreciated.
I have a workbook containing several sheets wherein on 4 of the sheets there is one identical column that we need to filter by.
I have the following code below. I've tested this code and it works - but only if ALL the sheets have the same identical columns. Like I said above, we have 3 sheets that contain completely different information. How can I modify the code below to make this work? Also, I have hardcoded the criteria. I would like it to be so that when a user uses the autofilter on column1, the criteria gets set to it.
Sub Test()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Range("A2").CurrentRegion.AutoFilter Field:=1, Criteria1:="03-00018-20-107-B-02-00-303-C"
Next
End Sub
Thank you so very much in advance.
Any help or push in the right direction is appreciated.