Another solution, without the loop. It should be faster.
Sub Button2_Click()
Dim lRow1 As Long
Dim lRow2 As Long
Dim rngData As Range
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
On Error Resume Next
With Sheet1
.AutoFilter.ShowAllData
lRow1 = .Cells(.Rows.Count, "B").End(xlUp).Row
.Range("B1:B" & lRow1).AutoFilter Field:=1, Criteria1:="A380-800"
Set rngData = .Range("B2:B" & lRow1).EntireRow.SpecialCells(xlCellTypeVisible)
End With
If Not rngData Is Nothing Then
With Worksheets("A380- 800s")
lRow2 = .Range("A" & .Rows.Count).End(xlUp).Row + 1
rngData.Copy .Cells(lRow2, "A")
End With
rngData.Delete
End If
Sheet1.AutoFilter.Range.AutoFilter
Application.Calculation = xlCalculationAutomatic
End Sub
Artik
Bookmarks