+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19

Thread: VBA to compare 2 sheets/workbooks

  1. #16
    Registered User
    Join Date
    04-01-2010
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: VBA to compare 2 sheets/workbooks

    I know, it's originally 2 workbooks but I combined them just for the example. Here, I'll separate them back out; though it does seem that it should work correctly if you have all the locations named appropriately. Either way, here they are again but separated.

    --BA Patterson.
    Attached Files Attached Files

  2. #17
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    19,226

    Re: VBA to compare 2 sheets/workbooks

    Hehe, I was really hoping you were going to upload a sheet that didn't look like that. Your request was unclear and the macro given compares cells in each workbook at the same address. Just listing values in column A of the second workbook means you're in for a macro maintenance nightmare...you'd have to have a line of code for every formula in the first workbook stating specifically which cell in column A of the second workbook to compare it to.

    Even the *smallest* of changes in your layout of WB1 would require tons of editing in your macro.

    In your WB2, put the expected values in the cells at the same address for the comparisons to work properly. The layout in the updated version is giving me correct comparisons.

    Remember that hidden "spaces" will cause text comparisons to fail. E2 failed until I made them actually match.
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

  3. #18
    Registered User
    Join Date
    04-01-2010
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Thumbs up Re: VBA to compare 2 sheets/workbooks

    Sweet Moses! We may be on to something here!

    I simply moved from listing them just down the column to making them all match the respective addresses.... Mission success. Only a couple of extra lines I need to add on to this now and I think we may have lift-off!

    Thank you very much, you're the man!

    --BA Patterson.

  4. #19
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    19,226

    Re: VBA to compare 2 sheets/workbooks

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

+ Reply to Thread

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.2.0