Hello Rita,
Dave might have something else in mind but here's a starting point:-
Sub Test()
Dim ar As Variant, i As Integer
Dim ws As Worksheet: Set ws = Sheets("MasterSheet")
ar = [{"Gardens","Dogs","Shop","Veggie";"Gardens-r-us","Dogs Eat Here","Shop Here","Veggie Shop"}]
Application.ScreenUpdating = False
For i = 1 To UBound(ar, 2)
Sheets(ar(1, i)).UsedRange.Offset(1).Clear
With ws.[A1].CurrentRegion
.AutoFilter 4, ar(2, i)
.Offset(1).EntireRow.Copy Sheets(ar(1, i)).Range("A" & Rows.Count).End(3)(2)
Sheets(ar(1, i)).Columns.AutoFit
.AutoFilter
End With
Next i
Application.ScreenUpdating = True
End Sub
I've attached your sample workbook with the code implemented and assigned to Scooby's image.. Click on Scooby's image to run the code.
BTW, you added your code to the ThisWorkbook module. I have removed it in the attached sample as it is not an event code and needed to be placed in a standard module. Check the Project Explorer to see what I mean.
I hope that this helps.
Cheerio,
vcoolio.
Bookmarks