Thread: hide-unhide
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
eliano[_2_] eliano[_2_] is offline
external usenet poster
 
Posts: 79
Default hide-unhide

Hi Hoy. :-)
For a very "personal" solution (no Button, etc), try:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)
Cancel = True

With ActiveSheet
If .Columns("c:t").Hidden = False Then
.Columns("c:t").Hidden = True
Else
.Columns("c:t").Hidden = False
End If
End With

End Sub

Saluti
Eliano



On 18 Mar, 19:37, hoysala wrote:
i have written the following code to hide a column

can anybody help me altering the program to swap between hide and
unhide using the same CommandButton ?

Private Sub CommandButton5_Click()

If ActiveSheet.Name = SHEETNAME Then

*If Worksheets(SHEETNAME).Columns("c:t").Hidden = False Then
* * *Worksheets(SHEETNAME).Columns("c:t").Hidden = True
* *End If

End If

End Sub