I have the following macro below to extract inventory from sheets "Shirts", "Trousers" and "Shoes" based on criteria on sheet "Overaged Inventory" in Cells Aa1:Aa2
I get a type mismatch and code below is highlighted
It would be appreciated if someone could kindly amend my code
I get a type mismatch and code below is highlighted
Code:
Sheets(ws).Range("A1:K2000").AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Range("AA1:AA2"), CopyToRange:=Range("A1"), Unique:=False
Code:
Sub Extract_Overaged()
Dim ws As Worksheet
Application.ScreenUpdating = False
For Each ws In Sheets(Array("Shirts", "Trousers", "Shoes"))
Sheets("Overaged Inventory").Select
Sheets(ws).Range("A1:K2000").AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Range("AA1:AA2"), CopyToRange:=Range("A1"), Unique:=False
Next ws
Application.ScreenUpdating = True
End Sub
It would be appreciated if someone could kindly amend my code
Last edited: