LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default Show/Hide Columns

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

 
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
Is there a quick way to show selected columns (not using hide) Anhlyss Excel Discussion (Misc queries) 1 February 18th 10 07:52 PM
How to show columns/cells in sheet but hide them in print? Jeff Korn Excel Discussion (Misc queries) 8 May 25th 08 05:54 PM
Shortcut for hide/show detail in grouped columns/rows Corey Excel Discussion (Misc queries) 1 November 20th 07 12:06 AM
Macro to hide/show rows and columns Leo Excel Discussion (Misc queries) 4 May 23rd 06 05:25 PM
how can hide and show columns using macro? Hoshyar Excel Worksheet Functions 4 September 2nd 05 03:45 PM


All times are GMT +1. The time now is 08:57 PM.

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

About Us

"It's about Microsoft Excel"