Identify whether worksheet contains rows that meet more than one criteria
Posted on 2011-09-11
Sheet #1 contains about 500 rows with column C defined as Group (numeric) and column D defined as Sub-Group (numeric), There are only about 75 unique combinations of Group/Sub-Group.
As part of a much larger process, the first step is to identify which combinations of Group/Sub-Group exist in Sheet #1 which don't exist in Sheet #2, which also contains Group (column A) and sub-group (Column B).
My intent is to loop through the rows of Sheet #1 and confirm whether there is a matching Group/Sub-group in Sheet #2. If not, I'll add that Group/sub combination to a message and after checking all of the rows, present a message box for my user.
The looping works just fine, I just have not been able to figure out how to determine whether a row matches more than one criteria. I know I could loop through each row of Sheet #2 and test both cells agains the cells from Sheet #1, but I'm looking for a more elegant method.