I'd like to be able to run a macro which would collapse or expand all grouped rows and columns for all selected worksheets. When I say collapse or expand, i don't need any selection dialog box or anything...just the code which would accomplish it. Thanks!!
You can merge the code I posted with the method of iterating through
selected worksheets that Domenic provided you in your recent post.
The result for Expand_All would look like this.
Dim sh As Object
For Each sh In ActiveWindow.SelectedSheets
If TypeName(sh) = "Worksheet" Then
sh.Outline.ShowLevels RowLevels:=8, ColumnLevels:=8
Set sh = Nothing
This works great for expanding all rows/columns. I'm having some trouble searching online to find code to expand only one group of columns. I'm running Excel 2010. Googling around, I'm finding code such as:
Range("B:C").Columns.ShowDetail = True
I'm also guessing with code such as:
I keep getting a "Runtime error 438: Object doesn't support this property or method".
Forgive me but I'm almost a total novice when it comes to writing code in VBA. My experience to date is recording clunky macros and then messing with the resulting code. Clicking on a particular "+" for a group doesn't generate any code when recording.