pencil pusher
New Member
- Joined
- Feb 24, 2016
- Messages
- 11
Hi everyone!
I am working on a workbook where I want to create a macro to compare the differences between two spreadsheets that have three columns of 1000's of data. That's three columns of data in one spreadsheet and three in the other.
I may not be explaining the best way to do this, but basically, I have data from inventory I took about a month ago and I want to determine the differences (additions and removals, and if there is no change) from that report to another report I generated about a year ago; so I can clearly see the changes (additions and removals, and if there is no change)
The data will not necessarily match in number of rows and will not be in order so it cannot be compared side-by-side. I would like the results to be displayed in a 3rd spreadsheet on the same workbook that will show the results of the matching three columns and then in a fourth column display whether it was added (something added to the inventory since a year ago) or removed (something removed from inventory since a year ago) or if there was no change. So I can easily spot and sort the deltas on the third spreadsheet.
Thanks for your help in advance!
here is an example of what the columns might look like
sheet 1 Report from a year ago
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]Order#[/TD]
[TD]Name[/TD]
[TD]QTY[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]Banana[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]Banana[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]Grape[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]Orange[/TD]
[TD]1[/TD]
[/TR]
</tbody>[/TABLE]
Sheet 2 Report Recently pulled (In my example I put the changes in bold red so you can see what I changed/Added)
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]Order#[/TD]
[TD]Name[/TD]
[TD]QTY[/TD]
[/TR]
[TR]
[TD]002
[/TD]
[TD]Apple
[/TD]
[TD]5
[/TD]
[/TR]
[TR]
[TD]003[/TD]
[TD]Banana[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]Banana[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]Orange[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]005
[/TD]
[TD]Watermelon
[/TD]
[TD]2
[/TD]
[/TR]
</tbody>[/TABLE]
sheet 3 Delta Results (additions/removals and if there was no changes on sheet 2 when compared to sheet 1)
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]Order#[/TD]
[TD]Name[/TD]
[TD]QTY[/TD]
[TD]Delta[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]Banana[/TD]
[TD]5[/TD]
[TD]No Change[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]Apple[/TD]
[TD]5[/TD]
[TD]Added[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]Banana[/TD]
[TD]4[/TD]
[TD]Removed[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]Grape[/TD]
[TD]5[/TD]
[TD]Removed[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]Orange[/TD]
[TD]1[/TD]
[TD]Removed[/TD]
[/TR]
[TR]
[TD]003[/TD]
[TD]Banana[/TD]
[TD]4[/TD]
[TD]Added[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]Orange[/TD]
[TD]8[/TD]
[TD]Added[/TD]
[/TR]
[TR]
[TD]005[/TD]
[TD]Watermelon[/TD]
[TD]2[/TD]
[TD]Added[/TD]
[/TR]
</tbody>[/TABLE]
I am working on a workbook where I want to create a macro to compare the differences between two spreadsheets that have three columns of 1000's of data. That's three columns of data in one spreadsheet and three in the other.
I may not be explaining the best way to do this, but basically, I have data from inventory I took about a month ago and I want to determine the differences (additions and removals, and if there is no change) from that report to another report I generated about a year ago; so I can clearly see the changes (additions and removals, and if there is no change)
The data will not necessarily match in number of rows and will not be in order so it cannot be compared side-by-side. I would like the results to be displayed in a 3rd spreadsheet on the same workbook that will show the results of the matching three columns and then in a fourth column display whether it was added (something added to the inventory since a year ago) or removed (something removed from inventory since a year ago) or if there was no change. So I can easily spot and sort the deltas on the third spreadsheet.
Thanks for your help in advance!
here is an example of what the columns might look like
sheet 1 Report from a year ago
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]Order#[/TD]
[TD]Name[/TD]
[TD]QTY[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]Banana[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]Banana[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]Grape[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]Orange[/TD]
[TD]1[/TD]
[/TR]
</tbody>[/TABLE]
Sheet 2 Report Recently pulled (In my example I put the changes in bold red so you can see what I changed/Added)
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]Order#[/TD]
[TD]Name[/TD]
[TD]QTY[/TD]
[/TR]
[TR]
[TD]002
[/TD]
[TD]Apple
[/TD]
[TD]5
[/TD]
[/TR]
[TR]
[TD]003[/TD]
[TD]Banana[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]Banana[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]Orange[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]005
[/TD]
[TD]Watermelon
[/TD]
[TD]2
[/TD]
[/TR]
</tbody>[/TABLE]
sheet 3 Delta Results (additions/removals and if there was no changes on sheet 2 when compared to sheet 1)
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]Order#[/TD]
[TD]Name[/TD]
[TD]QTY[/TD]
[TD]Delta[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]Banana[/TD]
[TD]5[/TD]
[TD]No Change[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]Apple[/TD]
[TD]5[/TD]
[TD]Added[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]Banana[/TD]
[TD]4[/TD]
[TD]Removed[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]Grape[/TD]
[TD]5[/TD]
[TD]Removed[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]Orange[/TD]
[TD]1[/TD]
[TD]Removed[/TD]
[/TR]
[TR]
[TD]003[/TD]
[TD]Banana[/TD]
[TD]4[/TD]
[TD]Added[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]Orange[/TD]
[TD]8[/TD]
[TD]Added[/TD]
[/TR]
[TR]
[TD]005[/TD]
[TD]Watermelon[/TD]
[TD]2[/TD]
[TD]Added[/TD]
[/TR]
</tbody>[/TABLE]
Last edited: