text: public static int CountMatchingCellsInArea(ThreeDEval areaEval, IMatchPredicate criteriaPredicate){int result = 0;for (int sIx = areaEval.FirstSheetIndex; sIx <= areaEval.LastSheetIndex; sIx++){int height = areaEval.Height;int width = areaEval.Width;for (int rrIx = 0; rrIx < height; rrIx++){for (int rcIx = 0; rcIx < width; rcIx++){ValueEval ve = areaEval.GetValue(sIx, rrIx, rcIx);if (criteriaPredicate is I_MatchAreaPredicate){I_MatchAreaPredicate areaPredicate = (I_MatchAreaPredicate)criteriaPredicate;if (!areaPredicate.Matches(areaEval, rrIx, rcIx)) continue;}if (criteriaPredicate.Matches(ve)){result++;}}}}return result;}