ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pivot table programming (https://www.excelbanter.com/excel-programming/372887-pivot-table-programming.html)

havocdragon

Pivot table programming
 
I have a line of code that grabs the totals lines from a pivot table and
formats them. However, if there is no data in a pivot tables, this line
errors out.

Is there a way to block this line if there is no data on a pivot table?

Die_Another_Day

Pivot table programming
 
Without seeing your code it's hard to come up with an exact solution,
however try getting the pivot items count and verify that it is 0,
something like this:
ActiveSheet.PivotTables("PivotTable1").PivotFields (1).PivotItems.Count

Charles

havocdragon wrote:
I have a line of code that grabs the totals lines from a pivot table and
formats them. However, if there is no data in a pivot tables, this line
errors out.

Is there a way to block this line if there is no data on a pivot table?




All times are GMT +1. The time now is 05:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com