Thread: Help with code
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Ken Johnson Ken Johnson is offline
external usenet poster
 
Posts: 1,073
Default Help with code

Hi Bobby,
for toggling show/hide try this macro:

Public Sub ShowHideUnNamedToggle()
Application.ScreenUpdating = False
Dim I As Long
Dim Hidden As Boolean
For I = 1 To 24
If Rows(I).EntireRow.Hidden Then
Hidden = True
Rows(I).EntireRow.Hidden = False
End If
Next I
If Hidden Then Exit Sub
For I = 1 To 21 Step 4
If Left(Cells(I, 1).Value, 4) = "Unit" Then
Range(Cells(I, 1), Cells(I + 3, 1)).EntireRow.Hidden = True
End If
Next I
End Sub

Assign macro to a button from the Forms toolbar, add the caption
"show/hide"

GoodLuck
Ken Johnson