However, you might want to fix the long lines in your code. Long lines are frowned upon.

Also, before posting to the UDF Forum, please read Guidelines() - for posting in the UDF forum and How to write a UDF .

Potential improvements: Optional flag to indicate that an array of entries that were removed is to be returned instead of the number of entries.
_________________________
There are two types of vessels, submarines and targets.