I have a macro the extracts data from Row 6 in col A on sheet "Imported Data" based on a code "DZ" in Col A
I want to include a second field which is in Col B containing "M1"
What I want to achieve it that where DZ appears in Col A and M1 appears in Col B from row 6 onwards, to extract only the data containing these criteria to sheet "extracted Data"
It would be appreciated if someone could assist me
I want to include a second field which is in Col B containing "M1"
What I want to achieve it that where DZ appears in Col A and M1 appears in Col B from row 6 onwards, to extract only the data containing these criteria to sheet "extracted Data"
Code:
Sub Extract_Data()
Sheets("Imported Data").Select
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
With ActiveSheet.Range("A6:R" & Lastrow)
.AutoFilter Field:=1, Criteria1:="DV", Operator:=xlFilterValues
.SpecialCells(xlCellTypeVisible).Copy Worksheets("Extracted Data").Range("A2")
.AutoFilter
End With
End Sub
It would be appreciated if someone could assist me