Take note of the changes below;
![]()
Private Sub CommandButton1_Click() Dim rngFilter As Range With Sheets("S04FLXLS") .AutoFilterMode = False Set rngFilter = .Range("B1:B" & .Rows.Count).End(xlUp) End With With rngFilter .AutoFilter Field:=2, Criteria1:=TextBox1.Value & "*" .Range("A1:N" & .Rows.Count).End(xlUp).SpecialCells(12).Copy Destination:=Sheet2.Range("A1") .AutoFilter End With End Sub
Bookmarks