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 4:26 AM, Benjamin Gilberg <gilberg.benja...@gmail.com
> wrote:

> I think I've taken a half step forward.  But now I'm locked in a circular
> argument with Excel.  It keeps telling me I have a next without a for.  If
> I remove the offending next it tells me I have a for without a next.
>
> Here's where I am now:
>
>
> 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_Cull").Range("a5:a600")
>
> For Each x In culllist
>     If whateverrow.Hidden = False Then
>         For Each y In CompareRange
>             If whateverrow.Hidden = False Then
>
>                 If x = y Then x.Select
>                 Selection.EntireRow.Hidden = True
>         End If
>
>         Next y
>     End If
>
>
> Next x
>
> End Sub
>
>
>
> On Wednesday, April 30, 2014 11:49:43 AM UTC-7, Benjamin Gilberg wrote:
>>
>> 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.
>



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