Private Sub FindMatchesBetweenOptexAndADP()
Dim rec_optex As optex_record
Dim rec_adp As ADP_Record
Set collection_adp_matches = New Collection
Set collection_optex_matches = New Collection
' since ADP count is larger... outside loop will be with adp records (FYI)
For Each rec_adp In collection_adp_raw
For Each rec_optex In collection_optex_raw
If rec_adp.settlement_date = rec_optex.settlement_date And _
rec_adp.maturity_date = rec_optex.maturity_date And _
rec_adp.trade_date = rec_optex.trade_date And _
rec_adp.balance = rec_optex.balance_amount Then
' If settlement, maturity, trade dates and balance / par value match (as they should)
' then that should uniquely identify the trade... I could add the price but that would involve decimal place accuracy being off...
collection_adp_matches.Add rec_adp
collection_optex_matches.Add rec_optex
End If
Next rec_optex
Next rec_adp
Application.ActiveCell.AddComment()
Debug.Print "Matches in OPTEX: " & collection_optex_matches.Count
Debug.Print "Matches in ADP: " & collection_adp_matches.Count
Im getting an compile error: syntax error and do not know why? please need help thanks
The Application.ActiveCell.AddComment() is also highlighted red which I do not know why?
Dim rec_optex As optex_record
Dim rec_adp As ADP_Record
Set collection_adp_matches = New Collection
Set collection_optex_matches = New Collection
' since ADP count is larger... outside loop will be with adp records (FYI)
For Each rec_adp In collection_adp_raw
For Each rec_optex In collection_optex_raw
If rec_adp.settlement_date = rec_optex.settlement_date And _
rec_adp.maturity_date = rec_optex.maturity_date And _
rec_adp.trade_date = rec_optex.trade_date And _
rec_adp.balance = rec_optex.balance_amount Then
' If settlement, maturity, trade dates and balance / par value match (as they should)
' then that should uniquely identify the trade... I could add the price but that would involve decimal place accuracy being off...
collection_adp_matches.Add rec_adp
collection_optex_matches.Add rec_optex
End If
Next rec_optex
Next rec_adp
Application.ActiveCell.AddComment()
Debug.Print "Matches in OPTEX: " & collection_optex_matches.Count
Debug.Print "Matches in ADP: " & collection_adp_matches.Count
Im getting an compile error: syntax error and do not know why? please need help thanks
The Application.ActiveCell.AddComment() is also highlighted red which I do not know why?