Results 1 to 18 of 18

Compare two worksheets and present differences in a third

Threaded View

  1. #1
    Registered User
    Join Date
    07-24-2011
    Location
    Ottawa
    MS-Off Ver
    Excel 2007
    Posts
    91

    Unhappy Compare two worksheets and present differences in a third

    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.
    Attached Files Attached Files
    Last edited by olivierpbeland; 07-24-2011 at 02:30 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1