Selected Answer
Style
Your requirement to not open the csv in Excel made this more complex than necessary perhaps but the attached file does what your question asks for, provided you follow the instructions in the file, storing and opening one of the .csv files (included in the Excel file for the benefit of other users).
Ensure that you have the Microsoft Scripting Runtime library installed (so the co.csv can be read) and that you have replaced the bold bit in the line:
CoCSVLoc = "C:\Users\John\Downloads\co.csv"
with the full path to the stored .csv file.
Then, with the other file BasketOrder.csv open in Excel, when the green button (labelled "Check Status in co.csv") is clicked, the macro below runs (with comments for your guidance):
Private Sub CompareCsv()
' NOTE: needs Microsoft Scripting Runtime enabled (via Tools/Referemces)
Dim FSO As Object, CoCVS As TextStream, CoTest As String
Dim CoCSVLoc As String, CoLine As String, CoLineNo As Long, CoArray() As String
Dim n As Long, m As Long, CoRej As Boolean
'state where the source .csv file is located and what will be tested
CoCSVLoc = "C:\Users\John\Downloads\co.csv"
CoTest = "rejected"
Set FSO = CreateObject("Scripting.FilesystemObject")
Set CoCVS = FSO.OpenTextFile(CoCSVLoc)
' gather the data from the source .csv file
With CoCVS
While Not .AtEndOfStream ' read the csv file line by line
CoLine = .ReadLine ' get next line
'apart from first (title) line
If CoLineNo <> 0 Then
ReDim Preserve CoArray(1 To 2, 1 To CoLineNo) ' resize ("horizontal") array
CoArray(1, CoLineNo) = Left(CoLine, InStr(2, CoLine, ",") - 1) ' put Symbol in array
CoArray(2, CoLineNo) = Right(CoLine, Len(CoLine) - InStrRev(CoLine, ",")) '' put Status in array
End If
CoLineNo = CoLineNo + 1 ' increment line number
Wend
.Close
End With
' check against open .csv file rows
With Workbooks("BasketOrder.csv").Sheets(1)
'loop backwards from last used row in column C
For n = .Cells(.Rows.Count, "C").End(xlUp).Row To 1 Step -1
'loop through array to check
CoRej = False ' set flag
For m = LBound(CoArray, 2) To UBound(CoArray, 2)
' set variable if match on both Symbol and test value
If CoArray(1, m) = .Cells(n, 3).Value And CoArray(2, m) = CoTest Then CoRej = True
Next m
If CoRej = True Then ' check flag
'found so make replacements
.Cells(n, "G").Value = .Cells(n, "L").Value
.Cells(n, "K").Value = "SL"
.Cells(n, "T").Value = "NA"
Else
.Rows(n).EntireRow.Delete 'otherwise remove row
End If
Next n
End With
' tell user
MsgBox "Done! (" & Now & ")"
End Sub
Note that I declared several variables which hopefully make sense. Also that I run backwards through BasketOrder.csv since some rows are deleted (and would mess up a forward running counter).
Hope this fixes your problem. If so, please remember to mark this Answer as Sdelected.