View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Hide unhide non-contiguous columns

Sub togglehiddencolumns()
Range("G:G,J:J,P:P,R:R").EntireColumn.Hidden = Not _
Range("G:G,J:J,P:P,R:R").EntireColumn.Hidden
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Saintsman" wrote in message
...
I use the following code to hide/unhide a range of cells using a tick box
With Columns("O:W")
.Hidden = Not .Hidden
End With

I want to do exactly the same for columns G,J,P,R ie if they are hidden
then
unhide them, if they are not hidden then hide them
Any help appreciated