S
StephanieH
I want my user to be able to show or hide several columns in my worksheet.
If they are already hidden, they should unhide and vice versa. The following
will unhide hidden columns, but will not hide unhidden columns. What am I
doing wrong?
Private Sub Detail_Click()
' Show/Hide Detail
If Columns("B:Y").Hidden = False Then
Columns("B:Y").Hidden = True
Range("a1").Activate
End If
If Columns("B:Y").Hidden = True Then
Columns("B:Y").Hidden = False
Range("a1").Activate
End If
End Sub
If they are already hidden, they should unhide and vice versa. The following
will unhide hidden columns, but will not hide unhidden columns. What am I
doing wrong?
Private Sub Detail_Click()
' Show/Hide Detail
If Columns("B:Y").Hidden = False Then
Columns("B:Y").Hidden = True
Range("a1").Activate
End If
If Columns("B:Y").Hidden = True Then
Columns("B:Y").Hidden = False
Range("a1").Activate
End If
End Sub