Results 1 to 13 of 13

Comparing 2 Rows By Looping Through Cells

Threaded View

axegrynder Comparing 2 Rows By Looping... 08-20-2015, 05:17 PM
AlphaFrog Re: Comparing 2 Rows By... 08-21-2015, 12:45 AM
axegrynder Re: Comparing 2 Rows By... 08-21-2015, 01:03 PM
axegrynder Re: Comparing 2 Rows By... 08-24-2015, 07:01 PM
AlphaFrog Re: Comparing 2 Rows By... 08-21-2015, 01:07 PM
axegrynder Re: Comparing 2 Rows By... 08-21-2015, 01:30 PM
axegrynder Re: Comparing 2 Rows By... 08-21-2015, 01:34 PM
AlphaFrog Re: Comparing 2 Rows By... 08-21-2015, 01:44 PM
AlphaFrog Re: Comparing 2 Rows By... 08-21-2015, 02:00 PM
axegrynder Re: Comparing 2 Rows By... 08-21-2015, 02:47 PM
AlphaFrog Re: Comparing 2 Rows By... 08-21-2015, 03:41 PM
AlphaFrog Re: Comparing 2 Rows By... 08-24-2015, 08:41 PM
axegrynder Re: Comparing 2 Rows By... 08-25-2015, 12:10 PM
  1. #1
    Registered User
    Join Date
    05-19-2015
    Location
    Houston, TX
    MS-Off Ver
    Pro 2013
    Posts
    30

    Comparing 2 Rows By Looping Through Cells

    I've uploaded my code with an example database.

    The macro is supposed to generate a report on what has changed between the "Current" and "Previous" sheets.

    The first step is to compare Current to Previous by the reference column and determine if there were any new records added. If so those records are copied to the "Report Comparison" sheet and highlighted yellow. This seems to be working.

    The second step is to compare Previous to Current and determine if there were any records that were deleted. If so those are copied to "Report Comparison" and highlighted green. This seems to be working also.

    Next the macro is to compare each record cell by cell, and if there is a particular cell that has been changed in a record, the entire row from Current is copied to "Report Comparison", but only the cell that changed is highlighted yellow and a comment is added to that cell showing what the previous value was( adding the comment has not been attempted in the code yet).

    The last section of the code is commented out for now, but I had started by looping the cells in one specific row to see if the code was correct before trying to also loop through all the rows. If I include this code the results aren't correct. All the rows from Current and Previous are getting copied to the report. I'm not sure where the code is wrong.

    Any help is appreciated. Thanks
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 06-21-2015, 07:57 AM
  2. [SOLVED] Looping through and deleting rows if cells contain a value
    By martinez77 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-08-2014, 01:02 PM
  3. Comparing Two Rows And Highlighting Different Cells
    By ExcelNewbieSK in forum Excel General
    Replies: 6
    Last Post: 01-18-2013, 03:13 PM
  4. Looping though range and comparing to current cell
    By Aussiexile in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-04-2010, 02:30 AM
  5. Comparing 2 cells and copying rows to new worksheet
    By craig456 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-06-2006, 01:09 PM
  6. Looping through rows in range AND comparing range cells
    By Damask in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-16-2006, 10:30 PM
  7. Comparing two cells in a colum with 2000 rows
    By thomas1075 in forum Excel General
    Replies: 3
    Last Post: 06-07-2005, 03:12 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