Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using the following sub to act as a

Status
Not open for further replies.

Yogi39

Technical User
Joined
Jun 20, 2001
Messages
273
Location
CA
Using the following sub to act as a filter....
I have about 5000 records.
This sub is low...!
is this the fastest way to show and hide rows based on the same logic of the below cod ?
can I incorporate the logic in a filter ?

Code:
Sub OptionButton3863_Click()
Dim rr As String
Application.ScreenUpdating = False
For Each r In Sheets("Master").Range("A:A")
If r.Row > 3 Then
If r = "" Then Exit For
    If IsNumeric(r) And r < 2000 Then
    r.EntireRow.Hidden = True
    Else
    r.EntireRow.Hidden = False
    End If

    If Not IsNumeric(r) Then
    rr = r.Value
    If GetDigits(rr) < 2000 Then
    r.EntireRow.Hidden = True
    Else
    r.EntireRow.Hidden = False
    End If
    End If
    
End If
Next
Application.ScreenUpdating = True
End Sub
 
Yogi,

Why not turn on the filter, macro recorder and see what you get. Then modify to fit.

:-)

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top