I have checked answers given in other questions, but since I am a newcomer to excel vba macros, I really can't find a way to get my problem solved using solutions provided.
EDIT: I am not able to write code on my own yet. I started one month ago with macros, copying and pasting from different posts, and editing as I needed, with many errors usually that I need to fix. It's pretty frustrating but I see this just too big of a problem to get it done on my own.
Thanks in advance for your kind help and shared knowledge.
I have two excel sheets that:
- Contain different columns, of which I need to check three of them for matching values
- Number of entries (rows) in both may differ (different lenght)
- Values may or may not be sorted
- For every value in row A, macro shall check value in row B and C, and compare against sheet2, and the same routine taking as reference values in sheet 2 against sheet 1.
- Row A is numerical, B is numerical, and C is text
Example:
Sheet 1
A B C D E
1 Code Revision Status
2 102 0 C
3 102 1 A
4 89 0 A
5 216 0 C
6 216 1 B
7 216 2 A
8 217 0 B
Sheet 2
A B C D E
1 Code Revision Status
2 102 0 A
3 102 1 A
4 89 0 A
5 90 0 A
6 216 0 C
7 216 1 B
8 216 2 A
9 16 0 A
After the macro runs, the result in Sheet 1 and Sheet 2 should be that:
- All values in column A in Sheet 2 that are missing in Sheet 1 shall be colored its background in, say, red.
- All values in column A in Sheet 1 that are missing in Sheet 2 shall be colored its background in, say, red.
- The same way, for values in column A that are matching in both sheets, missing 'Revisions' (Column B) in each sheet shall be highlighted the same way as in previous points 1 and 2
- finally, for rows that match both 'Code' and 'Revision' (Column A and B) in both sheets, in case that the 'Status' (Column C) is not matching, highlight in Sheet 1.
The result would color red the following cells:
Sheet 1:
- C2
- A8
Sheet 2:
- A5
- A9
Thanks again.