hello
I have sheet2 contains values in column B and sheet1 contains data from A:F . I want using advanced filter . so the result in sheet2 based on column B should match with column A in sheet1 and brings filterd data in row8 .
any chance to fixing this code
I have sheet2 contains values in column B and sheet1 contains data from A:F . I want using advanced filter . so the result in sheet2 based on column B should match with column A in sheet1 and brings filterd data in row8 .
VBA Code:
Sub AdvFilter()
Dim rCrit As Range
Dim ws As Worksheet
Set ws = Sheets("sheet2")
Set rCrit = ws.Range("B1:B2")
With ThisWorkbook.Worksheets("sheet1")
Range("A1", Range("E" & Rows.Count).End(xlUp)).Resize(, 5).AdvancedFilter 1, rCrit, Sheets("sheet2").Cells(8)
End With
End Sub