ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   fix switch view.... (https://www.excelbanter.com/excel-programming/391250-fix-switch-view.html)

J.W. Aldridge

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


Ron de Bruin

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


J.W. Aldridge

fix switch view....
 
Scratch that... Got it to work!

Thanx anyways!



All times are GMT +1. The time now is 04:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com