Thread: hiding rows
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default hiding rows

Here is some code. Blank columns will be made invisible.

Sub test()

Dim SearchCol As Variant
Dim difference As Double

SearchCol = Array("S", "AB", "AK", "AT", "BC", "BL", "BU", "CD", "CM", "CV")

For Each col In SearchCol
found = False
For RowCount = 24 To 158
If Cells(RowCount, col).Value <= -0.012 Then

found = True
Exit For
End If

Next RowCount
If found = False Then
Columns(col).Hidden = True
End If
Next col

End Sub

"Bumblebee" wrote:

I've got a table that goes form rows 24 to 158 and from colums D to DC and I
want the macro to search colums S, AB, AK, AT, BC, BL, BU, CD, CM, CV, and if
any cell in one of these columns has a number equal to or lower that -0.012
then that row I want shown, the rest hidden. How would I go about
constructing a macro to do this?