Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel General
Macro for comparing columns and highlighting matching/differences
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Claus Busch, post: 7428277"] Hi, Am Tue, 22 Apr 2014 12:59:03 -0700 (PDT) schrieb [email]harpreet.noni@gmail.com[/email]: try: Sub CompareCols() Dim LRowC As Long, LRowF As Long Dim rngCF As Range, rngCC As Range Dim n As Long Dim NoMatch As Boolean Application.ScreenUpdating = False With Sheets("Sheet1") LRowC = .Cells(Rows.Count, "C").End(xlUp).Row LRowF = .Cells(Rows.Count, "F").End(xlUp).Row n = 2 For Each rngCC In .Range("C2:C" & LRowC) For Each rngCF In .Range("F2:F" & LRowF) If rngCC = Int(rngCF) Then rngCC.Interior.Color = vbGreen .Range("D" & n) = rngCC .Range("D" & n).Interior.Color = vbGreen n = n + 1 NoMatch = False Exit For Else rngCC.Interior.Color = vbRed NoMatch = True End If Next If NoMatch = True Then .Range("D" & n) = "not found" n = n + 1 End If Next End With Application.ScreenUpdating = True End Sub Regards Claus B. [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel General
Macro for comparing columns and highlighting matching/differences
Top