+ Reply to Thread
Results 1 to 5 of 5

Need a seemingly simple macro to find differences between two columns

  1. #1
    Registered User
    Join Date
    12-06-2012
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2010
    Posts
    71

    Need a seemingly simple macro to find differences between two columns

    I have two sets of data coming from different tables in a SQL database, currently open in two different instances of Excel. There is a column named AMT_PREMIUM in both, with over 15,000 rows of data. The summed amount should be the same in both, but is slightly higher in one. One also has just 5 more rows of data, so rather than going manually through over 15,000 rows, I would like to run something that would pinpoint the rows where the data differs. Please let me know if you need any more information! Thanks in advance for the help.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Need a seemingly simple macro to find differences between two columns

    Without a sample of your spreadsheet there is not a lot that I can do to help you.

    How would I approach this?

    Use a Macro to:
    Put a formula in an unused column that returns a 1 if there is no match.
    Go to the first 1 and insert a cell to push the data down one row
    see if there is a match in the next row
    if so change the 1 to an X to flag the change
    if not then clear the 1
    Loop back and continue


    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    12-06-2012
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: Need a seemingly simple macro to find differences between two columns

    Yea, that definitely looks like it would work. Obviously I could do a check to see if the amounts in each column are equal without a macro, but I wouldn't be able to automatically push down the cells. I've attached a spreadsheet with the two columns I'm comparing. Thanks!
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Need a seemingly simple macro to find differences between two columns

    Try this as a start.


    Please Login or Register  to view this content.
    Last edited by mehmetcik; 03-23-2017 at 08:46 PM. Reason: Error corrected.

  5. #5
    Registered User
    Join Date
    12-06-2012
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: Need a seemingly simple macro to find differences between two columns

    At the moment I'm getting a Compile Error: Label not defined, highlighting "GoTo Quit" near the bottom. I very rarely use macros and thus am still a complete novice, but I'll try to see if I can fix this myself and update here if I find a solution. 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. Matching Two Columns and Find Differences
    By nankura in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-18-2016, 05:00 AM
  2. Newbie at Macros - tips for seemingly simple macro?
    By Drexl27 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-24-2015, 01:41 PM
  3. Find Differences between two columns, same row
    By XL4U in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-03-2015, 05:02 AM
  4. Seemingly simple retrieval of Pivot Table data
    By DJCurtley in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-13-2013, 09:05 PM
  5. Issue with seemingly simple SUM formula
    By jwesterfield in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-25-2013, 09:28 AM
  6. Seemingly Simple But Odd Problem Question
    By xfreez99 in forum Excel General
    Replies: 2
    Last Post: 07-28-2008, 09:23 AM
  7. Columns of data ... need a macro that can find differences of 0.06 & Fill Color them
    By rocket1406 in forum Excel Programming / VBA / Macros
    Replies: 28
    Last Post: 08-27-2007, 03:16 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