Hi all, I have been spending many hours looking for some code to do some relatively simple comparison task but I haven't been able to find an answer to my particular problem.
I have 2 worksheets "today" and "yesterday", each with the same number of columns but potentially different number of rows (each row is a different project). The structure of each sheet is:
NAME // IDNUMBER // COST YEAR1 // COST YEAR2 // MANY OTHER COLUMNS
aa // ABT-100 // 100 // 800 // etc...
bb // SRT-876 // 245 // 445 // etc...
and so on... (please note that the IDNUMBER has a string of letters and numbers separated by highphens).
I am looking for some VBA code to compare "yesterday" and "today" worksheets for any changes by ID NUMBER and paste any item that has changed in a third worksheet "changes" with some highlighting:
1) any item (IDNUMBER) that is in "yesterday" but not in "today" should be copied in the worksheet "changes" with the whole row highlighted in red (dropped item).
2) any item (IDNUMBER) that is not in "yesterday" but that is in "today" should be copied in the worksheet "changes" with the whole row highlighted in green (new item).
3) any item (IDNUMBER) that is both in "yesterday" and "today" should only be copied in the worksheet "changes" when some cell of the row has been modified (i.e. difference between "yesterday" and "today"), in which case, the modified cells should be highlighted in yellow. Ideally, when some changes occured for an item, I would like to be able to present both values in the same cell next to each other ("yesterday",s value in red and "today"'s value in green).
4) do nothing with items that haven't changed between "yesterday" and "today".
I am guessing that this would probably involve some pretty intense coding so efficiency of the code is probably important here.
I have tried my best to do this but just can't do it!
Please!!!! Can someone help me!!!
Many thanks.
Bookmarks