N
NPell
Whatrs wrong with this??
I either get an error saying no data, or can not be used with multiple
selection.
Sheets("Data").Select
Selection.AutoFilter Field:=10, Criteria1:="Criteria 1"
Range("A1").Offset(1, 0).Select
Range("A1:I1").Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.SpecialCells(xlCellTypeConstants, xlNumbers +
xlTextValues).Select
On Error GoTo ErrorTrap1
Selection.Copy
lastrow = Sheets("Criteria 1").Cells(Rows.Count,
"A").End(xlUp).Row
Sheets("Criteria 1").Range("A" & lastrow + 1).PasteSpecial
ErrorTrap1:
Application.CutCopyMode = False
Range("A1").Select
Sheets("Data").Select
Selection.AutoFilter Field:=10, Criteria1:="Criteria 2"
Range("A1").Offset(1, 0).Select
Range("A1:I1").Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.SpecialCells(xlCellTypeConstants, xlNumbers +
xlTextValues).Select
On Error GoTo ErrorTrap2
Selection.Copy
lastrow = Sheets("Criteria 2").Cells(Rows.Count,
"A").End(xlUp).Row
Sheets("Criteria 2").Range("A" & lastrow + 1).PasteSpecial
ErrorTrap2:
Application.CutCopyMode = False
Range("A1").Select
Any advice?
I either get an error saying no data, or can not be used with multiple
selection.
Sheets("Data").Select
Selection.AutoFilter Field:=10, Criteria1:="Criteria 1"
Range("A1").Offset(1, 0).Select
Range("A1:I1").Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.SpecialCells(xlCellTypeConstants, xlNumbers +
xlTextValues).Select
On Error GoTo ErrorTrap1
Selection.Copy
lastrow = Sheets("Criteria 1").Cells(Rows.Count,
"A").End(xlUp).Row
Sheets("Criteria 1").Range("A" & lastrow + 1).PasteSpecial
ErrorTrap1:
Application.CutCopyMode = False
Range("A1").Select
Sheets("Data").Select
Selection.AutoFilter Field:=10, Criteria1:="Criteria 2"
Range("A1").Offset(1, 0).Select
Range("A1:I1").Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.SpecialCells(xlCellTypeConstants, xlNumbers +
xlTextValues).Select
On Error GoTo ErrorTrap2
Selection.Copy
lastrow = Sheets("Criteria 2").Cells(Rows.Count,
"A").End(xlUp).Row
Sheets("Criteria 2").Range("A" & lastrow + 1).PasteSpecial
ErrorTrap2:
Application.CutCopyMode = False
Range("A1").Select
Any advice?