+ Reply to Thread
Results 1 to 15 of 15

compare workbooks

  1. #1
    Registered User
    Join Date
    03-05-2007
    Posts
    23

    compare workbooks

    Hello Everyone,

    I want to know is there a way I can check workbooks, and compare it to make sure they have the same exact data.

    I am running 38 workbooks from 2 different location and in each workbooks I have 12 worksheets name (Jan, Feb, March, April.. Dec) so in theory I end up having 76 workbooks...

    I want to make sure that workbook Table01_cue.xls sheet (Jan) match up with workbook Table01_Master.xls sheet (Jan) all the way through worksheet Dec. So I would be comparing 2 workbooks at a time with 12 worksheets and making sure that they ALL have the same exact data, including text...

    And if the data doesn’t match up I would like it to tell me where it doesn’t match up…


    Please help!!!


    Let me know if you need more information… please please help!!

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525
    Hi,
    Here's a start, this code opens a workbook in folder Invoice\
    checks to see if range A12 = hi if it doesn't then a message box says so

    it then closes the book and opens the next workbook in the folder

    If this is on the right track let us know and then we can work on it some more


    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-05-2007
    Posts
    23
    Hi Dave,

    First I would like to say Thanks for helping!!,

    I test your code(s) but it's not looping through the 12 sheets... in 2 workbooks, it only looking for "hi" in the workbook...

    what i need to do is, have it look at workbook Table01_cue.xls sheet Jan and workbook Table01_Master.xls sheet Jan and make sure that they are exact same data including text, and if the data isnt the same, give me a message stating that sheet Jan in Table01_cue.xls range A8 is not the same as sheet Jan in Table01_Master.xls range A8 ....

    sorry does this make sense?

    again, thank you

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Loop Through Workbooks and Worksheets

    Hi,
    I offered the code to get this started..
    now try this one , see if it loops through the folder and loops through the sheets displaying a msgbox for each sheet name in the workbook


    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-05-2007
    Posts
    23
    Hi Dave,

    yes, the codes loop though the workbooks to make sure there is Jan and Feb... I still need it to check sheet Jan (A1:N70) workbook Table01_cue.xls and compare it to sheet Jan (A1:N70) workbook Table01_Master.xls to make sure it have the exact data...

    thank you for your help and I really appericate this.

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525
    Quote Originally Posted by CThai
    Hi Dave,

    yes, the codes loop though the workbooks to make sure there is Jan and Feb... I still need it to check sheet Jan (A1:N70) workbook Table01_cue.xls and compare it to sheet Jan (A1:N70) workbook Table01_Master.xls to make sure it have the exact data...

    thank you for your help and I really appericate this.
    What happens if the data is different??

  7. #7
    Registered User
    Join Date
    03-05-2007
    Posts
    23
    Hi Dave

    If the data is different,then a pop up saying which sheet and range is different... is that possible... ?

  8. #8
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525
    Here is an add-in that compares two sheets even two workbooks,
    I could keep working on the other example but it would help if I had a workbook to look at.


    here's the site with the compare add-in
    http://www.cpearson.com/Zips/Compare.ZIP

  9. #9
    Registered User
    Join Date
    03-05-2007
    Posts
    23
    Hi Dave!

    Thank you soo much, that work wonderful... it was just want i needed..to be able to select the worksheets and compare it ..thanks a bunch!!!

  10. #10
    Registered User
    Join Date
    03-05-2007
    Posts
    23
    Ok i got ahead of myself... I was overly excited to see that it test the worksheets and compare 2 worksheets at a time... I am sorry about this, ... but how can i get it to test ALL the worksheets in the workbook and loop it through?


    thanks for your help and patience

  11. #11
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525
    I could keep working on the other example but it would help if I had a workbook to look at.

  12. #12
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    That is going to be a slow routine. It would be much quicker to copy the data from a known correct workbook 76 times than to check the contents of 76 workbooks.

  13. #13
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525
    Quote Originally Posted by CThai
    Ok i got ahead of myself... I was overly excited to see that it test the worksheets and compare 2 worksheets at a time... I am sorry about this, ... but how can i get it to test ALL the worksheets in the workbook and loop it through?


    thanks for your help and patience
    What would be the purpose of this project??

  14. #14
    Registered User
    Join Date
    03-05-2007
    Posts
    23
    Hi Dave

    The purpose of this project to make sure that both end(s) are pulling the correct data... Last year when we had a lot of errors with numbers not matching up... so this year we would like to be sure that the numbers we're pulling from are the correct one...

    That is going to be a slow routine. It would be much quicker to copy the data from a known correct workbook 76 times than to check the contents of 76 workbooks
    in regards to your question mikerickson: if we could pull from the correct data that would be wonderful, but the thing is, our numbers change frequently , this is for publication purpose... and we have to run it through 3 server before it is ready to go... a little confusing, a little more work, and a little frustration..but getting the correct data is really important...

    thanks for the advise and help.

  15. #15
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525
    Quote Originally Posted by CThai
    Hi Dave

    The purpose of this project to make sure that both end(s) are pulling the correct data... Last year when we had a lot of errors with numbers not matching up... so this year we would like to be sure that the numbers we're pulling from are the correct one...



    in regards to your question mikerickson: if we could pull from the correct data that would be wonderful, but the thing is, our numbers change frequently , this is for publication purpose... and we have to run it through 3 server before it is ready to go... a little confusing, a little more work, and a little frustration..but getting the correct data is really important...

    thanks for the advise and help.
    Hi,
    Can you not send the correct sheet out?
    or are you concerned about somebody changing the sheet??if that is the case you could protect the sheets...

+ 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