VBA filter grand total if blanks, if not skip filter

txdude311

New Member
Joined
Jul 26, 2016
Messages
5
Hello,

I am trying to edit a macro with some pivot tables. I am extremely novice with VBA editing and I would be extremely appreciative of your help :). The macro creates a pivot table and grand totals for monthly data. Sometimes the grand total must be adjusted with filters. At times I need to filter out "(blank)" fields and other "credit" and "debit" fields. How can I filter these out of the pivot in the macro if they are present in the data and skip the filter if they are not so the macro runs without stalling. Attached is a photo of the fields that sometimes appear in the data. Thank you so much!

Imgur: The most awesome images on the Internet

qMKHW
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,216,821
Messages
6,132,903
Members
449,768
Latest member
LouBa

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