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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excell - VBA

Status
Not open for further replies.

blazblaz

Technical User
Feb 3, 2002
71
0
0
CA
I have 300 rows data, and sorting it descending according column A. The value in column A can be 1,or 0. After sorting I want to hide all rows where the value in A is 0. Because I've sorted it as descending, I want to hide rows from first row where the column A is 0, to 65536. How can I find the first row and describe it in VBA ?

Thaanks for help
 
Why don't you use filtering, i.e. menu command Data/Filter/Autofilter?



Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
If you are doing this manually then I would take Glenn's suggestion, and if you are doing it in VBA I would also take Glenn's suggestion, eg:-

Code:
Sub Filter0()
    With Columns("A:A")
        .AutoFilter Field:=1, Criteria1:="<>0", Operator:=xlAnd
    End With
End Sub

Regards
Ken...........

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]

----------------------------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top