Forum Discussion
11392
Nov 04, 2020Copper Contributor
Excel VBA: Filter, cut, and paste to another sheet
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 Sub filter_...
HansVogelaar
Nov 04, 2020MVP
The code runs without error when I try it, but see if this version works for you:
Sub filter_copy_paste()
With Sheets("src").Range("A1").CurrentRegion
.AutoFilter Field:=2, Criteria1:="x"
.SpecialCells(xlCellTypeVisible).EntireRow.Copy _
Destination:=Sheets("dst").Range("A1")
End With
End Sub