I am trying to copy/paste rows from one worksheet to another if they meet multiple and/or criteria:
If the idea_status is NOT "closed", "deleted", OR "draft" and
the idea_submitted_date is LTE 12/31/2018 and
the next_action_date is LTF 12/31/2020
Then copy/paste.
I can get it working if only using the AND conditions. Once I try to add the OR it pulls back all the results. Any direction would be greatly appreciated!
Private Sub CommandButton1_Click()
a = Worksheets("Team Tracker Dump").Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To a
If Worksheets("Team Tracker Dump").Cells(i, 4).Value <> "Deleted" Or _
Worksheets("Team Tracker Dump").Cells(i, 4).Value <> "Closed" Or _
Worksheets("Team Tracker Dump").Cells(i, 4).Value <> "Draft" Then
If Worksheets("Team Tracker Dump").Cells(i, 6).Value <= #12/31/2018# Then
If Worksheets("Team Tracker Dump").Cells(i, 11).Value <= #12/31/2020# Then
Worksheets("Team Tracker Dump").Rows(i).Copy
Worksheets("Extraction").Activate
b = Worksheets("Extraction").Cells(Rows.Count, 1).End(xlUp).Row
Worksheets("Extraction").Cells(b + 1, 1).Select
ActiveSheet.Paste
End If
End If
End If
Next
Application.CutCopyMode = False
Worksheets("Team Tracker Dump").Activate
Worksheets("Team Tracker Dump").Cells(1, 1).Select
MsgBox ("Task is done")
End Sub
Bookmarks