EliseFreedman
Programmer
Hi there
I am trying to write a macro to get rid of all the blank rows in my pivot tables. I have several pivot tables on a single worksheet. I am using the following code
This code works fine if a blank row exists in the pivot table. However, if there is no blank row then the code crashes.
I have tried enclosing the .pivotItems line within an If statement but that didnt work either
Does anyone have any ideas
I am trying to write a macro to get rid of all the blank rows in my pivot tables. I have several pivot tables on a single worksheet. I am using the following code
Code:
With ActiveSheet.PivotTables("NumberCommencingPhysio").PivotFields( _
"Referral Month Number")
.PivotItems("(blank)").Visible = False
End With
I have tried enclosing the .pivotItems line within an If statement but that didnt work either
Code:
With ActiveSheet.PivotTables("NumberCommencingPhysio").PivotFields( _
"Referral Month Number")
If .PivotItems("(blank)").Visible = True
.PivotItems("(blank)").Visible = False
End if
End With
Does anyone have any ideas