Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / November 2007

Tip: Looking for answers? Try searching our database.

Hide rows within a range IF...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
drumsab - 26 Nov 2007 14:21 GMT
Greetings,
Newbie here so any help is appreciated.

Within the active worksheet, within the row range of Row 7 thru Row 1004, if
the value in Column CK for that Row is = 0, then hide the entire row.
Don Guillett - 26 Nov 2007 14:32 GMT
One way
sub hideifzero()
for i=1004 to 2 step-1
if cells(i,"ck")=0 then rows(i).hidden=true
next i
end sub
Signature

Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com

> Greetings,
> Newbie here so any help is appreciated.
>
> Within the active worksheet, within the row range of Row 7 thru Row 1004,
> if
> the value in Column CK for that Row is = 0, then hide the entire row.
drumsab - 26 Nov 2007 19:53 GMT
Thanks.

My spreadsheet is fairly big.  Any way to make the "hiding rows" go faster
than it does with this code?

> One way
> sub hideifzero()
[quoted text clipped - 8 lines]
> > if
> > the value in Column CK for that Row is = 0, then hide the entire row.
Don Guillett - 27 Nov 2007 13:53 GMT
Modify this to suit

Sub FilterOutZero()
   Range("a1").AutoFilter Field:=1, Criteria1:="<>0"
End Sub

Signature

Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com

> Thanks.
>
[quoted text clipped - 14 lines]
>> > if
>> > the value in Column CK for that Row is = 0, then hide the entire row.
Don Guillett - 27 Nov 2007 14:31 GMT
Or assisgn this to a shape or button from the drawing toolbar

Sub ToggleAutoFilter()
If ActiveSheet.AutoFilterMode Then
   ActiveSheet.AutoFilterMode = False
Else
   Range("ck1").AutoFilter Field:=1, Criteria1:="<>0"
End If
End Sub

Signature

Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com

> Modify this to suit
>
[quoted text clipped - 21 lines]
>>> > if
>>> > the value in Column CK for that Row is = 0, then hide the entire row.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.