byoung70104
New Member
- Joined
- Jul 8, 2013
- Messages
- 3
Hello,
I am fairly novice with Excel VBA and in searching the forum I haven't quite found what I'm looking for.
I'm using Excel 2007 however writing in compatability mode for other users who use Excel 2003.
I have three worksheets in one workbook, "List1", "List2", "Results". List 1 and 2 contain a single column of serial numbers, Results contains two columns "Extra in list 1" and "Extra in List 2". I have it broken the data into two sheets because users will scan serial numbers into list 1 while list 2 will be generated by another macro i have that reformats a report that the user will paste into the List 2 Sheet. The results sheet is separate because it will give the user a summary.
I would like to look at each cell in List 1 and see if it's in List 2, if it is, then I'd like to move to the next cell. If it is Not in list 2, I'd like to put it into the "Extra in list 1" section of the Results sheet.
Once I complete List 1, I'd like to look at each item in list 2 and see if its in List 1, if it is - move on, if it is not - Put it into the "Extra in list 2" section of the results sheet.
I hope this makes sense...here's what it would look like (in the regular version the macro could be comparing up to 1000 serial numbers).
LIST 1
[TABLE="class: grid, width: 150"]
<TBODY>[TR]
[TD]Serial Numbers
[/TD]
[/TR]
[TR]
[TD]12345
[/TD]
[/TR]
[TR]
[TD]12346
[/TD]
[/TR]
[TR]
[TD]12347
[/TD]
[/TR]
[TR]
[TD]12349
[/TD]
[/TR]
</TBODY>[/TABLE]
LIST 2
[TABLE="class: grid, width: 150"]
<TBODY>[TR]
[TD]Serial Numbers
[/TD]
[/TR]
[TR]
[TD]12345
[/TD]
[/TR]
[TR]
[TD]12346
[/TD]
[/TR]
[TR]
[TD]12348
[/TD]
[/TR]
[TR]
[TD]12341
[/TD]
[/TR]
</TBODY>[/TABLE]
RESULTS Sheet
[TABLE="class: grid, width: 400"]
<TBODY>[TR]
[TD]EXTRA ON LIST 1
[/TD]
[TD][/TD]
[TD]EXTRA ON LIST 2
[/TD]
[/TR]
[TR]
[TD]12347
[/TD]
[TD][/TD]
[TD]12348
[/TD]
[/TR]
[TR]
[TD]12349
[/TD]
[TD][/TD]
[TD]12341
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</TBODY>[/TABLE]
I hope this all makes sense, please let me know if there is any other information I could provide to clarify my questions.
Thank you for your time!
-BY
I am fairly novice with Excel VBA and in searching the forum I haven't quite found what I'm looking for.
I'm using Excel 2007 however writing in compatability mode for other users who use Excel 2003.
I have three worksheets in one workbook, "List1", "List2", "Results". List 1 and 2 contain a single column of serial numbers, Results contains two columns "Extra in list 1" and "Extra in List 2". I have it broken the data into two sheets because users will scan serial numbers into list 1 while list 2 will be generated by another macro i have that reformats a report that the user will paste into the List 2 Sheet. The results sheet is separate because it will give the user a summary.
I would like to look at each cell in List 1 and see if it's in List 2, if it is, then I'd like to move to the next cell. If it is Not in list 2, I'd like to put it into the "Extra in list 1" section of the Results sheet.
Once I complete List 1, I'd like to look at each item in list 2 and see if its in List 1, if it is - move on, if it is not - Put it into the "Extra in list 2" section of the results sheet.
I hope this makes sense...here's what it would look like (in the regular version the macro could be comparing up to 1000 serial numbers).
LIST 1
[TABLE="class: grid, width: 150"]
<TBODY>[TR]
[TD]Serial Numbers
[/TD]
[/TR]
[TR]
[TD]12345
[/TD]
[/TR]
[TR]
[TD]12346
[/TD]
[/TR]
[TR]
[TD]12347
[/TD]
[/TR]
[TR]
[TD]12349
[/TD]
[/TR]
</TBODY>[/TABLE]
LIST 2
[TABLE="class: grid, width: 150"]
<TBODY>[TR]
[TD]Serial Numbers
[/TD]
[/TR]
[TR]
[TD]12345
[/TD]
[/TR]
[TR]
[TD]12346
[/TD]
[/TR]
[TR]
[TD]12348
[/TD]
[/TR]
[TR]
[TD]12341
[/TD]
[/TR]
</TBODY>[/TABLE]
RESULTS Sheet
[TABLE="class: grid, width: 400"]
<TBODY>[TR]
[TD]EXTRA ON LIST 1
[/TD]
[TD][/TD]
[TD]EXTRA ON LIST 2
[/TD]
[/TR]
[TR]
[TD]12347
[/TD]
[TD][/TD]
[TD]12348
[/TD]
[/TR]
[TR]
[TD]12349
[/TD]
[TD][/TD]
[TD]12341
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</TBODY>[/TABLE]
I hope this all makes sense, please let me know if there is any other information I could provide to clarify my questions.
Thank you for your time!
-BY