Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Hidind rows conditionally

I need to scan rows in a range and hide them according to
the value of one of their columns.

Basically:

For Cell= E1 to E650
if E(XX)=0 hide row where E(XX) is.
Next

Thanks in advance

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Hidind rows conditionally

Hi
try:
Sub hide_rows()
Dim RowNdx As Long
Dim LastRow As Long
application.screenupdating=false
LastRow = ActiveSheet.Cells(Rows.Count, "E").End(xlUp).row
For RowNdx = LastRow To 1 Step -1
if cells(RowNdx,"E").value=0 then
Rows(RowNdx).hidden = True
End If
Next RowNdx
application.screenupdating=true
End Sub


--
Regards
Frank Kabel
Frankfurt, Germany

"Henri" schrieb im Newsbeitrag
...
I need to scan rows in a range and hide them according to
the value of one of their columns.

Basically:

For Cell= E1 to E650
if E(XX)=0 hide row where E(XX) is.
Next

Thanks in advance


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Hidind rows conditionally

It looks like it's working.
Thanks to all of you !


-----Original Message-----
Hi
try:
Sub hide_rows()
Dim RowNdx As Long
Dim LastRow As Long
application.screenupdating=false
LastRow = ActiveSheet.Cells(Rows.Count, "E").End(xlUp).row
For RowNdx = LastRow To 1 Step -1
if cells(RowNdx,"E").value=0 then
Rows(RowNdx).hidden = True
End If
Next RowNdx
application.screenupdating=true
End Sub


--
Regards
Frank Kabel
Frankfurt, Germany

"Henri" schrieb im

Newsbeitrag
...
I need to scan rows in a range and hide them according

to
the value of one of their columns.

Basically:

For Cell= E1 to E650
if E(XX)=0 hide row where E(XX) is.
Next

Thanks in advance


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Hidind rows conditionally

Try this Henri

Sub Example2()
Dim Lrow As Long
Dim CalcMode As Long
Dim StartRow As Long
Dim EndRow As Long
With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With

With ActiveSheet
.DisplayPageBreaks = False
StartRow = 1
EndRow = 650
For Lrow = EndRow To StartRow Step -1
If IsError(.Cells(Lrow, "E").Value) Then
'Do nothing, This avoid a error if there is a error in the cell

ElseIf .Cells(Lrow, "E").Value = "0" Then .Rows(Lrow).Hidden = True

End If
Next
End With
With Application
.ScreenUpdating = True
.Calculation = CalcMode
End With
End Sub


My new add-in have this option also
http://www.rondebruin.nl/easyfilter.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Henri" wrote in message ...
I need to scan rows in a range and hide them according to
the value of one of their columns.

Basically:

For Cell= E1 to E650
if E(XX)=0 hide row where E(XX) is.
Next

Thanks in advance



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
conditionally join rows Robert Excel Discussion (Misc queries) 0 December 8th 06 09:46 PM
Way to conditionally hide rows? Cuda Excel Worksheet Functions 3 November 10th 06 03:18 PM
Conditionally formatting rows junoon Excel Worksheet Functions 4 May 29th 06 10:36 PM
Conditionally Hide Rows tamato43 Excel Discussion (Misc queries) 4 May 11th 05 04:27 PM
Hiding Rows Conditionally Mike Hogan Excel Discussion (Misc queries) 2 December 9th 04 10:05 PM


All times are GMT +1. The time now is 07:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"