A
Anders
Hi All,
I have code that works to hide rows with < 0 value for a specific range. I
have 20+ ranges I need to specify (obviosly none are sequential or it would
be a much larger range). It works with 2 ranges specified, but not with any
more. Below is the working and non working code. Is the solution some sort
of Set Range at the beginning of the sub? I tried it but couldn't get it to
work.
''' Working Code
Sub hide_row2()
For Each cell In Range("B21:B26", "B30:B51")
cell.EntireRow.Hidden = cell.Value < 1
Next cell
End Sub
''' Non Working Code
Sub hide_row()
For Each cell In Range("B21:26", "B30:B51", "B57:B90", "B95:B112")
cell.EntireRow.Hidden = cell.Value < 1
Next cell
End Sub
TIA,
Anders
I have code that works to hide rows with < 0 value for a specific range. I
have 20+ ranges I need to specify (obviosly none are sequential or it would
be a much larger range). It works with 2 ranges specified, but not with any
more. Below is the working and non working code. Is the solution some sort
of Set Range at the beginning of the sub? I tried it but couldn't get it to
work.
''' Working Code
Sub hide_row2()
For Each cell In Range("B21:B26", "B30:B51")
cell.EntireRow.Hidden = cell.Value < 1
Next cell
End Sub
''' Non Working Code
Sub hide_row()
For Each cell In Range("B21:26", "B30:B51", "B57:B90", "B95:B112")
cell.EntireRow.Hidden = cell.Value < 1
Next cell
End Sub
TIA,
Anders