So I have two large tables on two separate sheets that I am trying to compare.
On both tables, 1 column have a unique value (never repeat)
What I'm trying to do is do a VBA macro to compare a column on one table against a cilumn on the other table and identify where a unique value exsist in the first table that is not on the 2nd table.
Once identified, all the rows of that unique value found will be inserted into the table located on sheet2
So for example:
On Sheet 1 I have:
[TABLE="width: 192"]
<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64"]comparing[/TD]
[TD="width: 64"]info1[/TD]
[TD="width: 64"]info2[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]red[/TD]
[TD]apple[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]blue[/TD]
[TD]pear[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]yellow[/TD]
[TD]berries[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]black[/TD]
[TD]we[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]orange[/TD]
[TD]orange[/TD]
[/TR]
</tbody>[/TABLE]
(this table has a name called "SourceTable")
On Sheet 2 I have:
[TABLE="width: 256"]
<colgroup><col width="64" span="4" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64"][TABLE="width: 256"]
<tbody>[TR]
[TD]comparing
[/TD]
[TD]info1
[/TD]
[TD]info2
[/TD]
[TD]Notes
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]yellow
[/TD]
[TD]berries
[/TD]
[TD]good
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]red
[/TD]
[TD]apple
[/TD]
[TD]good
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]blue
[/TD]
[TD]pear
[/TD]
[TD]bad
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[/TR]
</tbody>[/TABLE]
(just a note, the table on sheet1 pulls from a SQL query database and rows can be added upon refresh of the data. When that happens is all adjacent columns that were added on excel (for example the Notes column) get misaligned because there is no relationship between the manual column added (notes column) and the SQL table (unless its copied over to a 2nd table like what this is trying to do here)
End result would look like:
[TABLE="width: 256"]
<tbody>[TR]
[TD]comparing
[/TD]
[TD]info1
[/TD]
[TD]info2
[/TD]
[TD]Notes
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]yellow
[/TD]
[TD]berries
[/TD]
[TD]good
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]red
[/TD]
[TD]apple
[/TD]
[TD]good
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]blue
[/TD]
[TD]pear
[/TD]
[TD]bad
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]black
[/TD]
[TD]we
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]orange
[/TD]
[TD]orange
[/TD]
[TD]
[/TD]
[/TR]
</tbody>[/TABLE]
(not sure what happen to the boarders, but not relevant)
Did that kind of make sense?
Any ideas?
thanks
On both tables, 1 column have a unique value (never repeat)
What I'm trying to do is do a VBA macro to compare a column on one table against a cilumn on the other table and identify where a unique value exsist in the first table that is not on the 2nd table.
Once identified, all the rows of that unique value found will be inserted into the table located on sheet2
So for example:
On Sheet 1 I have:
[TABLE="width: 192"]
<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64"]comparing[/TD]
[TD="width: 64"]info1[/TD]
[TD="width: 64"]info2[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]red[/TD]
[TD]apple[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]blue[/TD]
[TD]pear[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]yellow[/TD]
[TD]berries[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]black[/TD]
[TD]we[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]orange[/TD]
[TD]orange[/TD]
[/TR]
</tbody>[/TABLE]
(this table has a name called "SourceTable")
On Sheet 2 I have:
[TABLE="width: 256"]
<colgroup><col width="64" span="4" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64"][TABLE="width: 256"]
<tbody>[TR]
[TD]comparing
[/TD]
[TD]info1
[/TD]
[TD]info2
[/TD]
[TD]Notes
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]yellow
[/TD]
[TD]berries
[/TD]
[TD]good
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]red
[/TD]
[TD]apple
[/TD]
[TD]good
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]blue
[/TD]
[TD]pear
[/TD]
[TD]bad
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[/TR]
</tbody>[/TABLE]
(just a note, the table on sheet1 pulls from a SQL query database and rows can be added upon refresh of the data. When that happens is all adjacent columns that were added on excel (for example the Notes column) get misaligned because there is no relationship between the manual column added (notes column) and the SQL table (unless its copied over to a 2nd table like what this is trying to do here)
End result would look like:
[TABLE="width: 256"]
<tbody>[TR]
[TD]comparing
[/TD]
[TD]info1
[/TD]
[TD]info2
[/TD]
[TD]Notes
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]yellow
[/TD]
[TD]berries
[/TD]
[TD]good
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]red
[/TD]
[TD]apple
[/TD]
[TD]good
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]blue
[/TD]
[TD]pear
[/TD]
[TD]bad
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]black
[/TD]
[TD]we
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]orange
[/TD]
[TD]orange
[/TD]
[TD]
[/TD]
[/TR]
</tbody>[/TABLE]
(not sure what happen to the boarders, but not relevant)
Did that kind of make sense?
Any ideas?
thanks