JugglerJAF
Active Member
- Joined
- Feb 17, 2002
- Messages
- 297
- Office Version
- 365
- Platform
- Windows
I have two columns of data (Columns A and B).
Some of the values are common to both lists.
Some values will appear on A but not on B.
Some values will appear on B but not on A.
Both lists should be of unique entries and will be sorted in ascending order.
The lists may be the same size, but will probably have different numbers of values.
I'm looking for a macro that will move the data so that where matches are found, they appear on the same line, and where there is no match, the list which does not contain a match will have a blank.
For example:
would become
NB: Asterisks in the tables above denote blank cells.
I used to have some code that did this, but lost it when I changed jobs. I must have had it saved at my old place of work, but not backed up anywhere!
Some of the values are common to both lists.
Some values will appear on A but not on B.
Some values will appear on B but not on A.
Both lists should be of unique entries and will be sorted in ascending order.
The lists may be the same size, but will probably have different numbers of values.
I'm looking for a macro that will move the data so that where matches are found, they appear on the same line, and where there is no match, the list which does not contain a match will have a blank.
For example:
Excel Workbook | ||||
---|---|---|---|---|
A | B | |||
1 | List 1 | List 2 | ||
2 | Alpha | Bravo | ||
3 | Bravo | Echo | ||
4 | Charlie | Foxtrot | ||
5 | Delta | Golf | ||
6 | Echo | Hotel | ||
7 | Golf | India | ||
8 | India | Juliet | ||
9 | Mike | Kilo | ||
10 | Papa | * | ||
11 | Romeo | * | ||
Sheet1 |
would become
Excel Workbook | ||||
---|---|---|---|---|
H | I | |||
1 | List 1 | List 2 | ||
2 | Alpha | * | ||
3 | Bravo | Bravo | ||
4 | Charlie | * | ||
5 | Delta | * | ||
6 | Echo | Echo | ||
7 | * | Foxtrot | ||
8 | Golf | Golf | ||
9 | * | Hotel | ||
10 | India | India | ||
11 | * | Juliet | ||
12 | * | Kilo | ||
13 | Mike | * | ||
14 | Papa | * | ||
15 | Romeo | * | ||
Sheet1 |
NB: Asterisks in the tables above denote blank cells.
I used to have some code that did this, but lost it when I changed jobs. I must have had it saved at my old place of work, but not backed up anywhere!