I have two buttons (Shapes) which when clicked each hide a different set of columns (see attached), the problem at the moment is that the user has to click a second time on each button to show 'all' columns before clicking the second button to hide the second set of columns:
Sub Blues()
Dim MyRange As Range
Set MyRange = Range("D:D,F:G,I:I,M:M,Q:Q,T:T,V:V,X:X,Z:Z")
MyRange.EntireColumn.Hidden = Not MyRange.EntireColumn.Hidden
End Sub
Sub Reds()
Dim MyRange As Range
Set MyRange = Range("B:C,E:E,H:H,K:L,P:P,R:S,U:U,W:W,Y:Y")
MyRange.EntireColumn.Hidden = Not MyRange.EntireColumn.Hidden
End Sub
Is there some way to adapt the code so that if clicking on the 'Reds' button, it hides the blue columns (as it currently does), but if the user clicks on the 'Blues' button, whilst the red columns are already hidden, it effectively shows all columns and then hides just the red columns and vice versa, so the user doesn't have to unhide all the columns first for each button to display the correct set of columns?
Many thanks
Bookmarks