+ Reply to Thread
Results 1 to 6 of 6

VBA Code to Compare worksheet 1 to Worksheet 2 and identify differences

  1. #1
    Registered User
    Join Date
    08-02-2012
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2010
    Posts
    16

    VBA Code to Compare worksheet 1 to Worksheet 2 and identify differences

    I have two worksheets. Worksheet 1 has payments from old system, worksheet 2 has payments from new system. I need to compare worksheet 2 to worksheet 1 and vice versa and identify (possibly by notation in 3rd column / missing from Sht 1 or missing from Sht2). I have two columns - Column A = employee #, column B = date of check. I use Excel 2010.

    I apologize if this is something quite simple but I've tried vlookup, index(match formulas but they don't work so I'm hoping someone has VBA code that does this.

    Thank you in advance for any help.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA Code to Compare worksheet 1 to Worksheet 2 and identify differences

    Please attach a sample book with a desired result showing in a separate sheet. Remove any confidential info. To attach a sample, go to advance then attachment.

  3. #3
    Registered User
    Join Date
    08-02-2012
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: VBA Code to Compare worksheet 1 to Worksheet 2 and identify differences

    File attached
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA Code to Compare worksheet 1 to Worksheet 2 and identify differences

    Which column is used for comparison purpose? A or B?

  5. #5
    Registered User
    Join Date
    08-02-2012
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: VBA Code to Compare worksheet 1 to Worksheet 2 and identify differences

    Column B, the check/ACH date. The employee either got paid from the old system (sheet1) or from the new sytem (sheet2).

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA Code to Compare worksheet 1 to Worksheet 2 and identify differences

    Mab,
    There are two codes attached. The top code returns yes, or no in sheet2 and the second code returns yes/no in sheet1.
    If I do match using column A, I get a different result. All values in sheet 2 column B will match with sheet1 but not the other way round. It make sense because all dates in sheet are in sheet1, but not the other way round.
    The size of the file has exceeds this forum's limit, so I had to remove the solution from column C in each sheet. Please run both codes. There are on the same module. The first(top) result will be in sheet2 and the second one in sheet1.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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