asked on
Sub FilterSheets()
Dim DataWs As Worksheet
Dim NewWs As Worksheet
Set DataWs = Sheets("Sheet1")
Set NewWs = Sheets("Sheet2")
NumRows = DataWs.UsedRange.Rows.Count
For x = 2 To NumRows
Code = DataWs.Cells(x, 1)
If Code Like "*02*" Then
NewWsRows = NewWs.UsedRange.Rows.Count + 1
DataWs.Rows(x).Copy NewWs.Rows(NewWsRows)
End If
Next
End Sub
Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.
TRUSTED BY
ASKER
Thanks a lot for the help