+ Reply to Thread
Results 1 to 10 of 10

VBA to compare two worksheets and output differences to third worksheet.

  1. #1
    Registered User
    Join Date
    06-13-2008
    Posts
    29

    VBA to compare two worksheets and output differences to third worksheet.

    Hello,

    Can someone pls. assist me in creating a macro that would compare two worksheets and their differences would be copied into a third worksheet in the same workbook? Several key criteria is needed:

    1) The third worksheet would need to note only the data from the 1st and 2nd worksheets (including headers) that had differences. An additional column would do the difference calculations for the data whereby numeric values are subtracted (worksheet 2 from worksheet 1 values) and non-numeric values would note "Pass" or "Fail".

    2) All data values that had differences would be formatted in yellow shading on the third worksheet.

    3) The unique ids from column A in worksheet 1 would have to have be noted in column A of the third worksheet; even if they didn't have a difference from worksheet 2.

    4) The third worksheet would need to note all of the columns noted in worksheet 1 and include the difference column for each unique column.

    5) Flexibility in code to allow for addition of new columns to analysis.

    Pls. see attached sample spreadsheet whereby Worksheet 1 = "dv file", Worksheet 2 = "price file" and Worksheet 3 = "Error" for purposes of this discussion.

    Thank you in advance.
    Attached Files Attached Files
    Last edited by maldonadocj; 04-09-2014 at 01:44 AM.

  2. #2
    Registered User
    Join Date
    06-13-2008
    Posts
    29

    Re: VBA to compare two worksheets and output differences to third worksheet.

    Hello,

    Can anyone pls assist me in this request? Any VBA genius up for a challenge?

    Thank you in advance.

  3. #3
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: VBA to compare two worksheets and output differences to third worksheet.

    Sometimes it is easier to go a different route...

    Take a look at this site... it is software I use and is cheap... i wouldnt want to try to replicate the functions myself

    http://sourceforge.net/projects/spreadshcompare/

    Cheers

    Jmac1947

    1. Please consider clicking on the * Add Reputation if you think this post has helped you
    2. Mark your thread as SOLVED when question is resolved

  4. #4
    Registered User
    Join Date
    06-13-2008
    Posts
    29

    Re: VBA to compare two worksheets and output differences to third worksheet.

    Hello Jmac1947,

    Thank you for your response. I agree that a different approach may be warranted. I'll review the output from the software tomorrow and revert back with the results.

    Thanks again.

  5. #5
    Registered User
    Join Date
    06-13-2008
    Posts
    29

    Re: VBA to compare two worksheets and output differences to third worksheet.

    Hello Jmac1947,

    I tested the software and unfortunately it had a critical issue. It only compared the first 4 columns of each worksheet for a total amount of 10,875 points of data.I ran a similar analysis using Microsoft's Excel Compare software and it had similar results. Would you happen to know why this issue is occurring?
    Thanks again.

  6. #6
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: VBA to compare two worksheets and output differences to third worksheet.

    Hello maldonadocj,

    I am picking (at random I must admit) is that in both cases there is a processing limit for the "free download" version.

    I haven't seen the same problem myself but that again I paid the $60 (I think) license fee as I needed it for commercial use and still use it regularly today. Money well worth it in my opinion.

    Jmac

  7. #7
    Registered User
    Join Date
    06-13-2008
    Posts
    29

    Re: VBA to compare two worksheets and output differences to third worksheet.

    Hello Jmac,

    I couldn't locate the commercial version. The version I have is freeware. Unfortunately, I believe you are correct that it may be processing capacity issue. I will ask that a ticket be started to see if this issue can be addressed. In the interim, if you are aware of another solution, pls. let me know.

    Thanks!

  8. #8
    Registered User
    Join Date
    06-13-2008
    Posts
    29

    Re: VBA to compare two worksheets and output differences to third worksheet.

    Hello Jmac,

    In the end I had to use EXACT functions for each column as opposed to using VBA. Thanks again for your assistance.

  9. #9
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: VBA to compare two worksheets and output differences to third worksheet.

    Hello maldonadocj

    Glad you got to the winning post

    If you are happy then please use the thread tools (top right of your first post) to mark the thread as solved

  10. #10
    Registered User
    Join Date
    06-13-2008
    Posts
    29

    Re: VBA to compare two worksheets and output differences to third worksheet.

    Will do.

    Thanks again

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Compare two worksheets and then generate a third worksheet showing their differences
    By wazimu13 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-04-2013, 06:37 AM
  2. Compare two strings and output the differences
    By aliastx in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-14-2013, 10:49 PM
  3. Compare 2 worksheets and compute differences in 3rd worksheet.
    By Maverick24 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-03-2013, 10:52 AM
  4. [SOLVED] Compare Cells and Output Differences
    By gunk in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-26-2013, 01:05 AM
  5. Compare 2 worksheets for differences
    By MikeWinn in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-31-2013, 05:02 PM

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