#1   Report Post  
Posted to microsoft.public.excel.programming
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide/Unhide row VBA Scafidel[_2_] Excel Discussion (Misc queries) 1 March 23rd 09 05:28 PM
hide-unhide Office_Novice Excel Programming 0 March 18th 08 07:11 PM
Hide/Unhide Help Danno[_7_] Excel Programming 3 July 26th 06 05:43 PM
Hide Unhide Colin Excel Discussion (Misc queries) 4 April 9th 06 05:01 PM
Hide/unhide Jock W Excel Worksheet Functions 4 October 4th 05 05:02 PM


All times are GMT +1. The time now is 07:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"