Getting an error on this code? Please help

Attiq4024

New Member
Joined
Aug 29, 2011
Messages
1
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?
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Welcome to the board.

The comment must actually contain something...

Application.ActiveCell.AddComment("Text for your comment goes here")
 
Upvote 0

Forum statistics

Threads
1,224,607
Messages
6,179,871
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top