Hi Benjamin Can you please let us know are all your values unique?
Do you want to compare the same row nos or cell. Numbers ? Reason I m asking is if the values r unique and it is found you can use exit for as soon as condtion is met Also is it possible for you to share a sample file with dummy data Regards Ashish koul Sent on my BlackBerry® from Vodafone -----Original Message----- From: Benjamin Gilberg <gilberg.benja...@gmail.com> Sender: excel-macros@googlegroups.com Date: Wed, 30 Apr 2014 11:49:43 To: <excel-macros@googlegroups.com> Reply-To: excel-macros@googlegroups.com Subject: $$Excel-Macros$$ VBA Compare only visible rows Hey everyone and thanks in advance for any help. I have a fairly simple macro, that worked wonders in my tiny test set, but is slogging along at an incredibly slow pace when I set it to run it's full scale application. The 'Cull_List' worksheet has already been filtered down somewhat from it's initial 1500 or so rows through a separate Macro, and the 'Static Pool Details' worksheet has been as well, but I'd love to figure out a way to have the compare only look at visible rows in each worksheet as it works through the compare. Thanks again for any help. And for the record, I program in VBA about once every 12 to 18 months, promptly forget everything I learned, and then have to try to struggle through it again the next time. So please assume that what I know would have trouble powering an ant's motorcycle around a bb. Ben Here's the code I'm working with Sub Check_Static() Dim CompareRange As Variant, x As Variant, y As Variant Set culllist = Worksheets("Cull_List").Range("a5:a1500") Set CompareRange = Worksheets("Static Pool Details").Range("a5:a1000") For Each x In culllist For Each y In CompareRange If x = y Then x.Select Selection.EntireRow.Hidden = True Next y Next x End Sub -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/d/optout. -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/d/optout.