The below code opens up a separate excel file (Assort O") and filters the tab OO for what is in cell K2 in the HOME sheet of wkbk1. It then copies the filtered data and pastes into worksheet OOb in wkbk1. I would like to now how to unfilter the OO tab in wkbk2 after the data has been copied from it. The code works, but I can't figure out how to clear the filter from the OO tab.
Thanks
VBA Code:
Sub CopyDataFromAssort()
Dim wkb1 As Workbook
Dim sht1 As Worksheet
Dim wkb2 As Workbook
Dim sht2 As Worksheet
Application.ScreenUpdating = False
Set wkb1 = ThisWorkbook
Set wkb2 = Workbooks.Open("S:\Merchandising\allocation\BUYER ASSORTMENT SHEETS\New Assortment Sheets\Assortment 2.0\Assort OO.xlsx")
Set sht1 = wkb1.Sheets("OOb")
Set sht2 = wkb2.Sheets("OO")
Set sht3 = wkb1.Sheets("Home")
sht1.Range("A2:AF150000").ClearContents
sht2.Range("a1:R150000").AutoFilter Field:=1, Criteria1:=[sht3].[K2]
sht2.Cells.Copy
sht1.Range("A1").PasteSpecial xlPasteValues
'sht2.Cells.ShowAllData
Application.CutCopyMode = False
'wkb2.AutoFilter tried this, didn't work
wkb2.Close True
Application.ScreenUpdating = True
End Sub
Thanks