Hi,

I have a problem with filtering my Database.
The thing is I need to filter against the range (counterparty IDs), which is located in a different page. For that purpose I activate that worksheet, and then the fun begins.

My code looks something like this:

Worksheets("CnptyNames").Activate
rst.Filter = "COUNTERPARTYCODE >= " & Range("e4") & "and COUNTERPARTYCODE <=" & Range("e26")

Here is the message I get:
"Run-time error "3001": Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another."


Any help will be very much appreciated.