Excel

  • Thread starter Thread starter Mary Contrary
  • Start date Start date
Sub togglehidecols()
Columns(2).Resize(, 4).Hidden = _
Not Columns(2).Resize(, 4).Hidden
End Sub
 
Add a button from the Forms Toolbar and assign this macro.

Sub toggle_columns()
Dim rng As Range
Set rng = Columns("D:I")
If rng.Hidden = True Then
rng.Hidden = False
Else
rng.Hidden = True
End If
End Sub

Note: Excel also has the "Custom Views" feature which requires no macro.

Simply switch from one View to the other.


Gord Dibben MS Excel MVP

On Fri, 22 Jan 2010 13:07:01 -0800, Mary Contrary <Mary
 
Is that a special application assistant's function? :-)

darn<> dang<> dagnabbit<> crikey<> beatmetoit<>
 
Back
Top