The following code unhide’s the hidden rows and refreshes the pivot tables with looping. How could I make the code to unhide the rows without looping and also refresh the pivot tables?
Private Sub Worksheet_Activate()
Dim pvt As PivotTable
Dim rw As Long
Application.ScreenUpdating = False
For Each pvt In Me.PivotTables
pvt.RefreshTable
Next pvt
Application.Calculation = xlCalculationManual
For rw = 48 To 1360
If Not Range("A" & rw) = "" Then
Range("A" & rw).EntireRow.Hidden = False
End If
Next rw
Application.Calculation = xlCalculationAutomatic
ScrollArea = "A1:AG1380"
Application.ScreenUpdating = True
End Sub
Private Sub Worksheet_Activate()
Dim pvt As PivotTable
Application.ScreenUpdating = False
For Each pvt In Me.PivotTables
pvt.RefreshTable
Next pvt
Range("A48:A1360").SpecialCells(xlCellTypeConstants).EntireRow.Hidden = False
ScrollArea = "A1:AG1380"
Application.ScreenUpdating = True
End Sub