[quote user="jelph9"]Could you please explain how you used the mdlScanCriteria_setRangeTest to search for elements?[/quote]
I believe that you are using VBA rather than MDL (that's an MDL function). Take a look at VBA's ElementScanCriteria class and the ModelReference.Scan method.
There are examples of model scanning in VBA help. There may be relevant VBA examples on our website.