C
celia
I have this code below suppose to hide the the whole row if any zer
values found in column D between D6 till D20
However, the code wouldn't work if any zero are found after row 11.
mean it can hide the rows if the zero are found before row 11. Can tr
out once the total sum are greater.
Please help me with the code.
Sub HideZeros1()
Dim IsHidden As Boolean
Dim i As Variant
i = 1
Dim RowsCount As Integer
Range("D6
6").Select
Selection.CurrentRegion.Select
RowsCount = Selection.Rows.Count
IsHidden = Selection.Range("D6
20").EntireRow.Hidden
For i = 1 To RowsCount
Range("D6
6").Offset(i, 0).Select
If ActiveCell.Value = 0 Then
Selection.EntireRow.Hidden = Not IsHidden
End If
Next
End Sub
Thanks,
celia
p/s can some one explain the line code starting from "IsHidden
Attachment filename: book1.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=52844
values found in column D between D6 till D20
However, the code wouldn't work if any zero are found after row 11.
mean it can hide the rows if the zero are found before row 11. Can tr
out once the total sum are greater.
Please help me with the code.
Sub HideZeros1()
Dim IsHidden As Boolean
Dim i As Variant
i = 1
Dim RowsCount As Integer
Range("D6

Selection.CurrentRegion.Select
RowsCount = Selection.Rows.Count
IsHidden = Selection.Range("D6

For i = 1 To RowsCount
Range("D6

If ActiveCell.Value = 0 Then
Selection.EntireRow.Hidden = Not IsHidden
End If
Next
End Sub
Thanks,
celia
p/s can some one explain the line code starting from "IsHidden
Attachment filename: book1.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=52844