+ Reply to Thread
Results 1 to 6 of 6

VBA: Compare 2 sheets for differences & create new sheet with differences.

  1. #1
    Registered User
    Join Date
    10-20-2017
    Location
    Dublin, Ireland
    MS-Off Ver
    2503 (Build 18623.20266 Click-to-Run)
    Posts
    55

    Question VBA: Compare 2 sheets for differences & create new sheet with differences.

    I need to compare maintenance programme revisions, for an aircraft.
    • 2 different revisions.
    • Revision 0 has number of tasks (c. 2000)
    • Revision 1 has new tasks, deleted tasks or tasks with changed due dates, times etc. (c. 2100)
    • Task data in each can be spread over multiple rows.
    • Aim: Compare Rev. 0 & Rev. 1 for new, deleted or revised data.
    • Example: Sheet attached.


    I typically use the following method (I would attach a video, but max ZIP file size is 9mb, video is 20mb).

    1. Extract sheet from Maintenance System, with tasks at Revision 0.
    2. Extract sheet from Maintenance System, with tasks at Revision 1.
    3. Copy 1st sheet in Excel, (tasks at Revision 0) to new 3rd sheet.
    4. Name 3rd sheet 'Comparison', between Revision 0 and Revision 1.
    5. Copy tasks from Revision 1 into the 3rd sheet also, for side-by-side comparison
    6. Use formula "=A1=B1", to compare tasks for new tasks, new due dates, etc.
    7. If a new task has been added, or task deleted a number of FALSE values will appear
    8. I manually cut these and paste into 4th sheet entitled 'Differences'
    9. Exercise Aim 1: Identify new or deleted tasks in 'Differences' sheet.
    10. Exercise Aim 2: Identify task differences in 'Comparison' sheet.

    Typically, there are 2000 tasks, with c. 500 differences, cutting takes a long time. Is there a less manual method of doing this?

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,861

    Re: Compare 2 sheets for differences & create new sheet with differences.

    Pretty sure this will require VBA - shall I move the thread for you?
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    10-20-2017
    Location
    Dublin, Ireland
    MS-Off Ver
    2503 (Build 18623.20266 Click-to-Run)
    Posts
    55
    Hi AliGW,

    That would be magnificent if you could move the thread? Thank you in advance!
    Last edited by AliGW; 09-26-2021 at 04:02 AM. Reason: PLEASE don't quote unnecessarily!

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,861

    Re: VBA: Compare 2 sheets for differences & create new sheet with differences.

    All done.

  5. #5
    Forum Expert
    Join Date
    01-25-2011
    Location
    Belgium, Alveringem
    MS-Off Ver
    Excel 2003, 2007, 365
    Posts
    1,459

    Re: VBA: Compare 2 sheets for differences & create new sheet with differences.

    Columns A:K, they remain unchanged and only columns L:N change ???
    Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,447

    Re: VBA: Compare 2 sheets for differences & create new sheet with differences.

    Hi Fionn,

    What if you appended both sheets into a single sheet called "Both"? See the attached:
    Aircraft Maintenance Programme - Differences check Concat CountIf.xlsx
    Then Concat all rows to a Helper Concat Column and then do a CountIf for each row? That would tell if anything had changed.. That is the rows that had a 1 would show they were unique.

    Does that help? No VBA needed so far.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

+ 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 sheets and get all differences
    By KingTamo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-14-2019, 11:02 PM
  2. Replies: 0
    Last Post: 04-13-2015, 01:01 PM
  3. [SOLVED] Compare two sheets, highlight differences
    By papasmurfuo9 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-11-2014, 05:12 PM
  4. Compare two sheets and report differences
    By mzaszczu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-28-2014, 10:46 AM
  5. Is it possible to compare two sheets and extract out the differences?
    By dwx in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-03-2014, 11:51 AM
  6. Replies: 0
    Last Post: 05-10-2013, 03:41 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