VBA: compare combinations of two cells

Nelson78

Well-known Member
Joined
Sep 11, 2017
Messages
526
Office Version
  1. 2007
Hello everybody.

I have the following job.

In sheet2 there are a variable number of association column A/B (in this case 5).

The goal is matching these 5 associations with the associations already present in sheet1:
- if already present, do nothing
- if not present, insert a row below the related item and report the unprecedented association.

The outcome has to be as you can see in the image

https://imgur.com/a/1MZVZEY
 
It works very well.

The problem is that in real life, as usual happens, we have to deal with something unexpected.

In this case, some of the 76 associations are not univocal: i need to report on the receiving sheet just one of them, to avoid duplicates.

https://imgur.com/s6yT0Xg

Yes, the easiest way is removing duplicates in the receiving sheet (it is no possible to perform it in the source).
But I wondered if it is viable to work directly on the combination array/dictionary.
 
Last edited:
Upvote 0

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top