Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code to Check for Pivot Item
I have some code that runs through a list of numbers, enters each one in a
page field of a pivot table, then extracts data from each version of that pivot. Up until recently, this has been working well, but I now have a situation where one of the numbers I'm using is not in the pivot field, and Excel is doing some weird stuff by renaming the closest item to the one that I'm trying to enter. Bottom line is that I need some code that checks for the existence of each number before using it as a page field. Can someone please give me some suggestions on how to do this? I tried running through all items for the respective pivot field, but for some reason, my simple routine (if pivot item = my number then run routine, otherwise skip) isn't working. Appreciate any help. Thanks, Todd |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code to Check for Pivot Item
try this
Found = False for each item in list if item = Mynumber then Found = True exit for end if next item if Found = True then 'enter your code here else 'enter your code here end if "T. Jenkins" wrote: I have some code that runs through a list of numbers, enters each one in a page field of a pivot table, then extracts data from each version of that pivot. Up until recently, this has been working well, but I now have a situation where one of the numbers I'm using is not in the pivot field, and Excel is doing some weird stuff by renaming the closest item to the one that I'm trying to enter. Bottom line is that I need some code that checks for the existence of each number before using it as a page field. Can someone please give me some suggestions on how to do this? I tried running through all items for the respective pivot field, but for some reason, my simple routine (if pivot item = my number then run routine, otherwise skip) isn't working. Appreciate any help. Thanks, Todd |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Check/TIck the selected Item List in Pivot Table | Excel Programming | |||
Check/TIck the selected Item List in Pivot Table | Excel Programming | |||
Pivot Item: removing non-existant item from the drop down | Excel Programming | |||
Menu Item check mark?? | Excel Programming | |||
Using a Check Box as a control item | Excel Discussion (Misc queries) |