1st sheet named src while the 2nd one is dst which is an empty sheet at the moment.
My plan is to filter string x in column B, cut it and paste it to 2nd sheet dst
VBA code
However, there is an error when I run it and when I hit Debug, it highlights line number 5 which is With .AutoFilter.Range
What wrong in this code and what should I do to fix it?
Desired output in 1st sheet "src"
Desired output in 2nd sheet "dst"
My plan is to filter string x in column B, cut it and paste it to 2nd sheet dst
VBA code
VBA Code:
Sub filter_copy_paste()
With Sheets("src")
.Range("A1").AutoFilter Field:=2, Criteria1:="x"
With .AutoFilter.Range
With .SpecialCells(xlCellTypeVisible).EntireRow
.Copy
With Sheets("dst")
.Paste
.[A1].Select
End With
End With
End With
End With
End Sub
However, there is an error when I run it and when I hit Debug, it highlights line number 5 which is With .AutoFilter.Range
What wrong in this code and what should I do to fix it?
Desired output in 1st sheet "src"
Desired output in 2nd sheet "dst"