Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.
Sub PivotExpander() Dim WS As Worksheet Dim pt As PivotTable Dim rNext As Range RGroup For Each WS In ActiveWorkbook.Worksheets If WS.Name <> "test" Then WS.Select For Each pt In WS.PivotTables With pt.TableRange1 If Application.CountA(.Offset(.Rows.Count).Resize(10)) Then .Offset(.Rows.Count).Resize(20).EntireRow.Insert With pt.TableRange1 .Offset(-1).Resize(.Rows.Count + 21).EntireRow.Group End With End If End With Next pt ActiveSheet.Outline.ShowLevels RowLevels:=1 End If Next WS End Sub Sub RGroup() Dim WS As Worksheet On Error Resume Next For Each WS In ActiveWorkbook.Worksheets If WS.Name <> "test" Then WS.Select Cells.Select Selection.Rows.UnGroup Selection.Rows.Hidden = False Range("A1").Select End If Next WS End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.