Hi!
I know there have been a lot of threads for finding the unique values using macro but my problem is unique in its own way.
I need to compare 2 columns from two sheets of the same workbook and find the unique value. The data that I need is from Sheet 2 column C. Sheet1 Column B has a lot of #N/A and zeros because these were v-looked up using another column (but that's another story)
[TABLE="class: grid, width: 300, align: left"]
<tbody>[TR]
[TD]Sheet1[/TD]
[TD]Sheet2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Column B[/TD]
[TD]Column C[/TD]
[/TR]
[TR]
[TD]Apple[/TD]
[TD]Melon[/TD]
[/TR]
[TR]
[TD]Orange[/TD]
[TD]Pear[/TD]
[/TR]
[TR]
[TD]Grape[/TD]
[TD]Guava[/TD]
[/TR]
[TR]
[TD]Lime[/TD]
[TD]Grape[/TD]
[/TR]
[TR]
[TD="align: center"]#N/A[/TD]
[TD]Lime[/TD]
[/TR]
[TR]
[TD]Pear[/TD]
[TD]Kiwi[/TD]
[/TR]
[TR]
[TD="align: right"]0[/TD]
[TD]Melon[/TD]
[/TR]
[TR]
[TD]Guava[/TD]
[TD]Lemon[/TD]
[/TR]
[TR]
[TD]Melon[/TD]
[TD]Banana[/TD]
[/TR]
[TR]
[TD="align: center"]#N/A[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I need to identify the unique values in column C Sheet 2 in comparison to column B Sheet 1. All unique values from Sheet 2 column C, will then be added to the lastrow+1 of Sheet 1 column B. so it should look like this:
[TABLE="class: grid, width: 150"]
<tbody>[TR]
[TD]Sheet 1[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Column B[/TD]
[/TR]
[TR]
[TD]Apple[/TD]
[/TR]
[TR]
[TD]Orange[/TD]
[/TR]
[TR]
[TD]Grape[/TD]
[/TR]
[TR]
[TD]Lime[/TD]
[/TR]
[TR]
[TD]#N/A[/TD]
[/TR]
[TR]
[TD]Pear[/TD]
[/TR]
[TR]
[TD]0[/TD]
[/TR]
[TR]
[TD]Guava[/TD]
[/TR]
[TR]
[TD]Melon[/TD]
[/TR]
[TR]
[TD]#N/A[/TD]
[/TR]
[TR]
[TD]Kiwi[/TD]
[/TR]
[TR]
[TD]Lemon[/TD]
[/TR]
[TR]
[TD]Banana[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Both columns have dynamic ranges. The problem with my formulas is that column B sheet 1 has a lot of 0's and #N/A's and the row number is different from Column c sheet 2, so formulas doesn't really work as it cannot find the real unique values.
I would really appreciate it if anyone could help me I'm very new to VBA, and I am just halfway through with my macro. this problem is holding me backs for weeks now.
Thanks!
I know there have been a lot of threads for finding the unique values using macro but my problem is unique in its own way.
I need to compare 2 columns from two sheets of the same workbook and find the unique value. The data that I need is from Sheet 2 column C. Sheet1 Column B has a lot of #N/A and zeros because these were v-looked up using another column (but that's another story)
[TABLE="class: grid, width: 300, align: left"]
<tbody>[TR]
[TD]Sheet1[/TD]
[TD]Sheet2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Column B[/TD]
[TD]Column C[/TD]
[/TR]
[TR]
[TD]Apple[/TD]
[TD]Melon[/TD]
[/TR]
[TR]
[TD]Orange[/TD]
[TD]Pear[/TD]
[/TR]
[TR]
[TD]Grape[/TD]
[TD]Guava[/TD]
[/TR]
[TR]
[TD]Lime[/TD]
[TD]Grape[/TD]
[/TR]
[TR]
[TD="align: center"]#N/A[/TD]
[TD]Lime[/TD]
[/TR]
[TR]
[TD]Pear[/TD]
[TD]Kiwi[/TD]
[/TR]
[TR]
[TD="align: right"]0[/TD]
[TD]Melon[/TD]
[/TR]
[TR]
[TD]Guava[/TD]
[TD]Lemon[/TD]
[/TR]
[TR]
[TD]Melon[/TD]
[TD]Banana[/TD]
[/TR]
[TR]
[TD="align: center"]#N/A[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I need to identify the unique values in column C Sheet 2 in comparison to column B Sheet 1. All unique values from Sheet 2 column C, will then be added to the lastrow+1 of Sheet 1 column B. so it should look like this:
[TABLE="class: grid, width: 150"]
<tbody>[TR]
[TD]Sheet 1[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Column B[/TD]
[/TR]
[TR]
[TD]Apple[/TD]
[/TR]
[TR]
[TD]Orange[/TD]
[/TR]
[TR]
[TD]Grape[/TD]
[/TR]
[TR]
[TD]Lime[/TD]
[/TR]
[TR]
[TD]#N/A[/TD]
[/TR]
[TR]
[TD]Pear[/TD]
[/TR]
[TR]
[TD]0[/TD]
[/TR]
[TR]
[TD]Guava[/TD]
[/TR]
[TR]
[TD]Melon[/TD]
[/TR]
[TR]
[TD]#N/A[/TD]
[/TR]
[TR]
[TD]Kiwi[/TD]
[/TR]
[TR]
[TD]Lemon[/TD]
[/TR]
[TR]
[TD]Banana[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Both columns have dynamic ranges. The problem with my formulas is that column B sheet 1 has a lot of 0's and #N/A's and the row number is different from Column c sheet 2, so formulas doesn't really work as it cannot find the real unique values.
I would really appreciate it if anyone could help me I'm very new to VBA, and I am just halfway through with my macro. this problem is holding me backs for weeks now.
Thanks!