I have the following problem that I need to solve with VBA:
I have two lists in the same sheet with 3 columns each with multiple rows (about 100). I would like to compare both lists and return the mismatches in another range in the same sheet.
The second list is the master list and the Shorter List is a subset of the Master List.
BEFORE
Shorter List: Master List:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Industry[/TD]
[TD]Sub-Industry[/TD]
[TD]Sub-Sub-Industry[/TD]
[TD][/TD]
[TD]Industry[/TD]
[TD]Sub-Industry[/TD]
[TD]Sub-Sub-Industry[/TD]
[/TR]
[TR]
[TD]AAA[/TD]
[TD]BBB[/TD]
[TD]CCC[/TD]
[TD][/TD]
[TD]DDD[/TD]
[TD]BBB[/TD]
[TD]FFF[/TD]
[/TR]
[TR]
[TD]AAA[/TD]
[TD]BBB[/TD]
[TD]PPP[/TD]
[TD][/TD]
[TD]AAA[/TD]
[TD]BBB[/TD]
[TD]CCC[/TD]
[/TR]
[TR]
[TD]DDD[/TD]
[TD]BBB[/TD]
[TD]EEE[/TD]
[TD][/TD]
[TD]AAA[/TD]
[TD]BBB[/TD]
[TD]PPP[/TD]
[/TR]
[TR]
[TD]XXX[/TD]
[TD]YYY[/TD]
[TD]UUU[/TD]
[TD][/TD]
[TD]DDD[/TD]
[TD]BBB[/TD]
[TD]EEE[/TD]
[/TR]
[TR]
[TD]OOO[/TD]
[TD]RRR[/TD]
[TD]TTT[/TD]
[TD][/TD]
[TD]XXX[/TD]
[TD]YYY[/TD]
[TD]ZZZ[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]XXX[/TD]
[TD]YYY[/TD]
[TD]UUU[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]OOO[/TD]
[TD]PPP[/TD]
[TD]QQQ[/TD]
[/TR]
</tbody>[/TABLE]
AFTER
[TABLE="width: 500"]
<tbody>[TR]
[TD]Industry[/TD]
[TD]Sub-Industry[/TD]
[TD]Sub-Sub-Industry[/TD]
[/TR]
[TR]
[TD]DDD[/TD]
[TD]BBB[/TD]
[TD]FFF[/TD]
[/TR]
[TR]
[TD]XXX[/TD]
[TD]YYY[/TD]
[TD]ZZZ[/TD]
[/TR]
[TR]
[TD]OOO[/TD]
[TD]PPP[/TD]
[TD]QQQ[/TD]
[/TR]
</tbody>[/TABLE]
Thanks for your help!
I have two lists in the same sheet with 3 columns each with multiple rows (about 100). I would like to compare both lists and return the mismatches in another range in the same sheet.
The second list is the master list and the Shorter List is a subset of the Master List.
BEFORE
Shorter List: Master List:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Industry[/TD]
[TD]Sub-Industry[/TD]
[TD]Sub-Sub-Industry[/TD]
[TD][/TD]
[TD]Industry[/TD]
[TD]Sub-Industry[/TD]
[TD]Sub-Sub-Industry[/TD]
[/TR]
[TR]
[TD]AAA[/TD]
[TD]BBB[/TD]
[TD]CCC[/TD]
[TD][/TD]
[TD]DDD[/TD]
[TD]BBB[/TD]
[TD]FFF[/TD]
[/TR]
[TR]
[TD]AAA[/TD]
[TD]BBB[/TD]
[TD]PPP[/TD]
[TD][/TD]
[TD]AAA[/TD]
[TD]BBB[/TD]
[TD]CCC[/TD]
[/TR]
[TR]
[TD]DDD[/TD]
[TD]BBB[/TD]
[TD]EEE[/TD]
[TD][/TD]
[TD]AAA[/TD]
[TD]BBB[/TD]
[TD]PPP[/TD]
[/TR]
[TR]
[TD]XXX[/TD]
[TD]YYY[/TD]
[TD]UUU[/TD]
[TD][/TD]
[TD]DDD[/TD]
[TD]BBB[/TD]
[TD]EEE[/TD]
[/TR]
[TR]
[TD]OOO[/TD]
[TD]RRR[/TD]
[TD]TTT[/TD]
[TD][/TD]
[TD]XXX[/TD]
[TD]YYY[/TD]
[TD]ZZZ[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]XXX[/TD]
[TD]YYY[/TD]
[TD]UUU[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]OOO[/TD]
[TD]PPP[/TD]
[TD]QQQ[/TD]
[/TR]
</tbody>[/TABLE]
AFTER
- this has to be written next to the Master List on the same sheet
- these are all the mismatches, i.e. industries that are not in the shorter list
[TABLE="width: 500"]
<tbody>[TR]
[TD]Industry[/TD]
[TD]Sub-Industry[/TD]
[TD]Sub-Sub-Industry[/TD]
[/TR]
[TR]
[TD]DDD[/TD]
[TD]BBB[/TD]
[TD]FFF[/TD]
[/TR]
[TR]
[TD]XXX[/TD]
[TD]YYY[/TD]
[TD]ZZZ[/TD]
[/TR]
[TR]
[TD]OOO[/TD]
[TD]PPP[/TD]
[TD]QQQ[/TD]
[/TR]
</tbody>[/TABLE]
Thanks for your help!