+ Reply to Thread
Results 1 to 7 of 7

Comparing two sheets with different layouts for differences

  1. #1
    Registered User
    Join Date
    11-23-2016
    Location
    England
    MS-Off Ver
    2013
    Posts
    16

    Question Comparing two sheets with different layouts for differences

    Hi, I'm fairly new to using VBA and I'm stuck with creating a script that will check through two sheets for any differences and output the summary onto a third sheet.
    When preparing the data I need to move around columns and rows so the order will mostly be different to how it was originally. it needs to be able to check for inconsistencies in the values and also if there are any rows or columns missing/added.

    Here's an example of the end result I'm hoping for:

    Original data sheet
    Example1.jpg

    Prepared data sheet
    Example2.jpg

    Summary sheet
    Example3.jpg

    So as you can see the value for 'Item 4' in store has changed somewhere along the workflow and the check will alert me of that.
    The sheets themselves can have hundreds of stores an items so it needs to allow for that as well.

    If anyone can help me with creating the script / pointing me in the right direction of how it can be done I'd really appreciate it.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Comparing two sheets with different layouts for differences

    In order that we can understand the scale, how many stores and how many items are there. i.e. what are the dimensions of the tables.

    Would you also upload a representative workbook. It needn't consist of full size tables, but ensure it contains both missing items and difference in quantities.
    Last edited by Richard Buttrey; 11-23-2016 at 06:52 AM.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    11-23-2016
    Location
    England
    MS-Off Ver
    2013
    Posts
    16

    Re: Comparing two sheets with different layouts for differences

    Quote Originally Posted by Richard Buttrey View Post
    In order that we can understand the scale, how many stores and how many items are there. i.e. what are the dimensions of the tables.

    Would you also upload a representative workbook. It needn't consist of full size tables, but ensure it contains both missing items and difference in quantities.
    Hi Richard, thanks for the response.

    The number of stores/items can vary from just a few to hundreds as they're orders from different clients.

    In the attached workbooks 'New' tab, the values that have changed are highlighted in yellow, Store 9 missing and item 7 missing
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-23-2016
    Location
    England
    MS-Off Ver
    2013
    Posts
    16

    Re: Comparing two sheets with different layouts for differences

    Sorry to bump this but is anyone able to help me out please?

  5. #5
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,002

    Re: Comparing two sheets with different layouts for differences

    Here is an example project I located for you. Hope it performs as you need it to. Results are written on Sheet3

    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Comparing two sheets with different layouts for differences

    Hi

    Does the attached offer you a way forward?

    The way I'd use it in the real world is to identify a complete list of Items & Stores and make sure that they are all included on the New sheet. I've shown as an example an Item99 and Store999 which isn't on the Original sheet.
    Attached Files Attached Files

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,278

    Re: Comparing two sheets with different layouts for differences

    The OP has now posted to the commercial services section, so I am closing this thread.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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. VBA comparing 2 sheets highlight differences.
    By KK33317 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-28-2015, 09:29 PM
  2. Linking Cells in Different Sheets with Different Layouts
    By TinyShiny in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-22-2014, 02:13 PM
  3. Comparing data on 2 sheets (varying rows) and highlight differences in 3rd
    By Gti182 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-16-2014, 03:22 AM
  4. Replies: 1
    Last Post: 02-08-2014, 04:34 PM
  5. Replies: 1
    Last Post: 11-08-2013, 08:54 AM
  6. [SOLVED] Comparing two sheets for differences
    By papasmurfuo9 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-16-2013, 06:43 AM
  7. Comparing sheets, finding and referencing differences
    By churtis in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-02-2010, 08:02 AM

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