+ Reply to Thread
Results 1 to 6 of 6

Macro to compare Col C from two sheets and paste the row in Result Sheet if not matching

  1. #1
    Forum Contributor
    Join Date
    12-26-2015
    Location
    UAE
    MS-Off Ver
    2013
    Posts
    128

    Macro to compare Col C from two sheets and paste the row in Result Sheet if not matching

    Hello All,

    I am using Excel 2013 and have the following problem as shown in the attached sample

    There are 3 Sheets – viz Statement 1, Statement 2 and Result

    Statement 1 – has 3 columns
    Col A – Date
    Col B – Doc No
    Col C – Total

    Statement 2 – has 3 columns
    Col A – Date
    Col B – Doc No
    Col C – Total

    I want a macro which should compare Statement 1 Sheet Column C (Total) with Statement 2 Sheet Col C (Total). If there is a match then ignore that row.
    If it is not matching then the entire row from Statement 1 Sheet should be copied on result sheet with the Headings in Row 1

    I have shown few outputs on the Result sheet and colored them for explanation purpose only

    Thanks in advance

    Rehana
    Attached Files Attached Files

  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,824

    Re: Macro to compare Col C from two sheets and paste the row in Result Sheet if not matchi

    Please update your user profile to show the correct version of Excel.

    Do you have the PowerQuery add-in?
    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
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Macro to compare Col C from two sheets and paste the row in Result Sheet if not matchi

    Just compare ColC with ColC?
    Please Login or Register  to view this content.

  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,824

    Re: Macro to compare Col C from two sheets and paste the row in Result Sheet if not matchi

    See if the attached PQ solution does what you want. If so, I can talk you through how to load the two source data tables and then merge them to provide the answer.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    12-26-2015
    Location
    UAE
    MS-Off Ver
    2013
    Posts
    128

    Re: Macro to compare Col C from two sheets and paste the row in Result Sheet if not matchi

    Thanks for all your help as always
    Regards

  6. #6
    Forum Contributor
    Join Date
    12-26-2015
    Location
    UAE
    MS-Off Ver
    2013
    Posts
    128

    Re: Macro to compare Col C from two sheets and paste the row in Result Sheet if not matchi

    Thanks for your solution
    I have the code which works for me
    But it would be good to know the steps of your solution too
    Regards

+ 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. Macro to compare two sheets and result in 3rd sheet
    By vinod2802 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-08-2016, 07:27 AM
  2. Replies: 30
    Last Post: 08-17-2015, 01:18 AM
  3. Compare 2 sheets and copy new records into result sheet
    By Chandrahaas in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-05-2014, 04:28 AM
  4. Vba code to compare the 2 sheets and paste the values in 3rd sheet
    By Abinaya in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-02-2014, 01:47 AM
  5. How To Compare Two Excel Sheets & Get Desired Result In Third Sheet!!
    By bmiguy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-14-2013, 12:30 AM
  6. [SOLVED] Macro to compare data between sheets and copy/paste
    By ScabbyDog in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-24-2012, 05:46 PM
  7. Compare multi Columns in Different Sheets and Post it result on a 3rd sheet
    By steven.demei in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-19-2011, 07:18 AM

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