Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Toggle Hide/Show


-----Original Message-----
Greetings,
I would like button that the first time its clicked, will

hide columns C:G and when clicked the next time will show
the same columns. I can write the code to separately hide
or show but I dont know how to combine them to toggle when
the button is clicked.
All help is greatly appreciated!
Alan
.

Alan

This will do. Right click the sheet tab and select View
Code. Paste the following macro then assign it to a button.

Sub ToggleHidden()
Dim rng As Range
Set rng = Range(Cells(1, 3), Cells(1, 7))
rng.EntireColumn.Hidden = rng.EntireColumn.Hidden = False

End Sub

Regards
Peter
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
Toggle show / hide group outline symbols with shortcut Ted M H Excel Discussion (Misc queries) 7 April 23rd 23 07:44 PM
Hide data series in chart - toggle on and off stef Charts and Charting in Excel 3 April 23rd 23 09:01 AM
How DO I get the bold face toggle to show Bruce Plizak e-mail [email protected] New Users to Excel 1 May 28th 10 01:08 AM
using a toggle button to show or hide information in several cells hanson Excel Worksheet Functions 3 December 7th 07 10:16 PM
Toggle Hide/Show Bob Phillips[_6_] Excel Programming 0 January 29th 04 04:12 PM


All times are GMT +1. The time now is 11:09 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"