Remove Blanks from Pivot Table VBA

Bryan123

New Member
Joined
May 23, 2019
Messages
41
Hi All,

How do you remove a row with "(blank)" from a pivot table which is also producing count for blanks? VBA

Count of StatusColumn Labels
Row Labels > 5 DaysNAUncorrectedWithin 1 DayWithin 5 DaysGrand Total
Claims - Credit & Surety Claims 1 1
Claims - Long Tail 22
Claims - Short Tail 61 7
Claims - Workers Compensation - Claims 11 3 5
Policy Support Services - Credit Control 14 6 11
Policy Support Services - Elders 2 4 6
Policy Support Services - Financial Institution 235111
Policy Support Services - Motorcycle 4 4
(blank)113 113
Grand Total1132194193160
<colgroup><col width="305" style="width: 229pt; mso-width-source: userset; mso-width-alt: 9760;"> <col width="129" style="width: 97pt; mso-width-source: userset; mso-width-alt: 4128;"> <col width="66" style="width: 50pt; mso-width-source: userset; mso-width-alt: 2112;"> <col width="27" style="width: 20pt; mso-width-source: userset; mso-width-alt: 864;"> <col width="96" style="width: 72pt; mso-width-source: userset; mso-width-alt: 3072;"> <col width="93" style="width: 70pt; mso-width-source: userset; mso-width-alt: 2976;"> <col width="101" style="width: 76pt; mso-width-source: userset; mso-width-alt: 3232;"> <col width="91" style="width: 68pt; mso-width-source: userset; mso-width-alt: 2912;"> <tbody> </tbody>
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Hi Bryan,

Try this:

Code:
    With ActiveSheet.PivotTables([COLOR=#ff0000]"PivotTable1"[/COLOR]).PivotFields([COLOR=#0000ff]"data"[/COLOR])
        .PivotItems("(blank)").Visible = False
    End With

You need to change Pivot Table name (red font) and column name where all your "Row Labels" reside (blue font).
You can also try to record the macro and remove "(blank)" from Row Labels - this should guide you in the right direction.

Hope it helps.
 
Upvote 0

Forum statistics

Threads
1,215,038
Messages
6,122,798
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top