Sub macros_sample()
    Dim baserange As Range
    Dim cl As Range

    Set baserange =
Sheets("Sheet1").Range("a2:a2500").SpecialCells(xlCellTypeVisible)

    Application.EnableEvents = False
    Application.Calculation = xlCalculationManual
    For Each cl In baserange

        If cl.Value <> "" Then
            If
Application.WorksheetFunction.CountIf(Sheets("Sheet2").Range("a:A"),
cl.Value) >= 1 Then
                cl.EntireRow.Hidden = True
            End If
        End If
    Next

    Application.EnableEvents = True
    Application.Calculation = xlCalculationAutomatic

End Sub


On Thu, May 1, 2014 at 12:55 AM, Benjamin Gilberg <
gilberg.benja...@gmail.com> wrote:

> Hi Benjamin
>
> Can you please let us know are all your values unique? - Yes the values
> are unique.  It's a list of invoice numbers.  The first is a master list
> that has been culled to remove a certain group of clients.  The second set
> is a list of clients that we've had difficulties with.  The compare is
> designed to remove this second set of clients from the master list as
> well.  Leaving me a new list of a certain grouping of clients.  The reason
> I'm hiding instead of deleting is because the individual working with the
> new list won't always have access to the master list, and I'd like them to
> have the information available.
>
> Do you want to compare the same row nos or cell. Numbers ?  - The idea is
> that if your invoice appears in the second set, I'd like to pull you from
> the master list as well.  They are both in Column A of their respective
> worksheets
>
> 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 - That would be an excellent
> addition, but It would still be great to eliminate all the hidden rows from
> the compare.
>
> Also is it possible for you to share a sample file with dummy data - I've
> attached my tiny test file, but unfortunately due to sensitive information
> I can't attach the large master list.
>
>
> Hope this helps clarify for you.
>
> Ben
> Regards
>
> Ashish koul
>
>
> On Wednesday, April 30, 2014 11:56:06 AM UTC-7, ashish wrote:
>
>> 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
>> ------------------------------
>> *From: * Benjamin Gilberg <gilberg....@gmail.com>
>> *Sender: * excel-...@googlegroups.com
>> *Date: *Wed, 30 Apr 2014 11:49:43 -0700 (PDT)
>> *To: *<excel-...@googlegroups.com>
>> *ReplyTo: * excel-...@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...@googlegroups.com.
>> To post to this group, send email to excel-...@googlegroups.com.
>>
>> Visit this group at http://groups.google.com/group/excel-macros.
>> For more options, visit https://groups.google.com/d/optout.
>>
>


-- 
*Regards*

*Ashish Koul*


*Visit*
http://www.excelvbamacros.in
Like Us on Facebook <https://www.facebook.com/excelvbacodes>
Join Us on Facebook <http://www.facebook.com/groups/163491717053198/>


P Before printing, think about the environment.

-- 
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.

Reply via email to