Custom function

Custom function

I am looking for help with a custom function that will do the following:

Look to see if Report B contains any products from Report A and then delete any product records from Report A that havent been used.

There could be more than 5000 products that need to be deleted.

Thanks in advance

Sean