Hey All....i am having an issue with one specific circumstance. I am filtering a worksheet & pasting the 2 data types(BLUE & RED) into their own worksheets. A problem occurs when one of the data types(BLUE) is non-existent & i cant seem to fix it (im assuming my A2:J range specification is part of the problem, but i just keep messing more up when troubleshooting). I'm hoping one of you will call me out for any nonsense below and provide a simpler solution...
Sub A_FilterMoveCOLORSs()
'
' FilterMoveIDs Macro
' filter and move IDs to new worksheet
'
lastrow = Sheets("qry_Export").Range("A" & Rows.Count).End(xlUp).row
'move COLOR 1
Sheets("qry_Export").Select
Cells.Select
Selection.AutoFilter
ActiveSheet.Range("A:J").AutoFilter Field:=10, Criteria1:="BLUE"
Sheets("qry_Export").Select
Range("A2:J" & lastrow).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("BLUEID").Select
Range("A2").Select
ActiveSheet.Paste
'move COLOR 2
Sheets("qry_Export").Select
Cells.Select
Selection.AutoFilter
ActiveSheet.Range("A:J").AutoFilter Field:=10, Criteria1:="RED"
Sheets("qry_Export").Select
Range("A2:J" & lastrow).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("REDID").Select
Range("A2").Select
ActiveSheet.Paste
End Sub
Bookmarks