ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cycling Through Page Fields (https://www.excelbanter.com/excel-programming/411730-cycling-through-page-fields.html)

T. Jenkins

Cycling Through Page Fields
 
I have a routine that cycles through page fields in a pivot table using VB
code. For the most part, things work fine, but every now and then, I have an
item in my list that doesn't exist in the data generating the pivot table.
The code is generating some errors as a result, I think because it's
overwriting the previous item in the page field list with the one I'm trying
to look at.

Is there an error check step that would help me avoid this? I just want to
code to skip this item if it doesn't exist in the Pivot Table.

Thanks,
Todd


Debra Dalgleish

Cycling Through Page Fields
 
There's sample code here that will check for each item before changing
the page field:

http://www.contextures.com/xlPivot09.html

Under the heading 'Check for Pivot Items Before Printing'

T. Jenkins wrote:
I have a routine that cycles through page fields in a pivot table using VB
code. For the most part, things work fine, but every now and then, I have an
item in my list that doesn't exist in the data generating the pivot table.
The code is generating some errors as a result, I think because it's
overwriting the previous item in the page field list with the one I'm trying
to look at.

Is there an error check step that would help me avoid this? I just want to
code to skip this item if it doesn't exist in the Pivot Table.

Thanks,
Todd



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html



All times are GMT +1. The time now is 08:10 PM.

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