Reputation: 94
It's possible to group certain columns in Excel with the following code.
Is it also possible to collapse (hide) that group in order to hide them when plotting the sheet?
Sheets("Blad2").Select
Columns("D:H").Select
Selection.Columns.Group
Upvotes: 1
Views: 7750
Reputation: 19367
For a column within the Group:
Set ws = ActiveSheet
ws.Columns(4).ShowDetail = False
Alternatively, define a Custom View
with the columns hidden and switch to this view. Define another View with the columns visible so that you can easily switch between the Views.
ActiveWorkbook.CustomViews("test").Show
You could also create a macro that does the hiding and unhiding of columns.
Upvotes: 2