Hiding a Selection
Posted by Phil D. Gonzalez on January 04, 2002 7:36 AM
Need some VBA help with this one.
What I need done is to somehow "hide" a selected range (see current code below).
---------------------
Dim CellRef As Range
For Each CellRef In Range("Q4:Q1202")
If CellRef.Value = "Y" Then
Range(CellRef.Address).EntireRow.Select
'Need to somehow hide this selected range
End If
Next
---------------------
The reason for wanting to hide the selection rather than using "CellRef.EntireRow.Hidden = True" is because the tested cell is actually merged, and what I actually need hidden is 2 rows (the row where the "Y" value resides, and the row immediately after that).
I found that by "selecting" the entire row where the merged cell resides, that both rows I need hidden are selected. So thus the need for hiding the "selection".
If there is an easier way to get the end result (both rows hidden) then I'll be glad to hear it.