Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default fix switch view....

Need two columns to be hidden based on macro button.
I got the following formula from a previous question and adapted it by
adding a second column (L:L) to fit my needs but it only does L:L and
not K:K

Any help?

Sub SwitchView()
With ActiveSheet.Range("K:K,L:L").EntireColumn
.Hidden = Not .Hidden
End With
End Sub


thanx

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default fix switch view....

Scratch that... Got it to work!

Thanx anyways!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default fix switch view....

Use it like this

Sub SwitchView()
With ActiveSheet.Range("K:L").EntireColumn
.Hidden = Not .Hidden
End With
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"J.W. Aldridge" wrote in message oups.com...
Need two columns to be hidden based on macro button.
I got the following formula from a previous question and adapted it by
adding a second column (L:L) to fit my needs but it only does L:L and
not K:K

Any help?

Sub SwitchView()
With ActiveSheet.Range("K:K,L:L").EntireColumn
.Hidden = Not .Hidden
End With
End Sub


thanx

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
How to turn off Page Layout View as default view Colin Halliday New Users to Excel 3 October 12th 07 02:37 AM
How do I view color onscreen (it shows up in print view only) janice Excel Discussion (Misc queries) 1 August 15th 06 07:32 PM
How to create a button to switch to a custom view Turquoise_dax[_3_] Excel Programming 1 June 15th 06 07:55 PM
Switch to worksheet view Paul Breslin Excel Programming 2 October 1st 04 06:09 AM
VBA Code to switch view Adrian[_7_] Excel Programming 2 August 29th 04 10:14 PM


All times are GMT +1. The time now is 04:17 AM.

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"