Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Pivot Table field macro
When I use private sub code below all works fine unless I add a field
not in the pivot then this code doesnt work how can i make sure that if i choose a field which is not in the pivot the vb will not input it ?? Cheers If Target.Count 1 Then Exit Sub If IsEmpty(Target.Value) Then Exit Sub If Target.Address = "$B$1" Then Worksheets("Pivot").PivotTables( _ "PivotTable1").PivotFields( _ "Month").CurrentPage = Target.Value |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Pivot Table field macro
If you meant that the problem occurs if you choose an Item that's not in
the pivot field, 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' You could use something similar in your code. wrote: When I use private sub code below all works fine unless I add a field not in the pivot then this code doesnt work how can i make sure that if i choose a field which is not in the pivot the vb will not input it ?? Cheers If Target.Count 1 Then Exit Sub If IsEmpty(Target.Value) Then Exit Sub If Target.Address = "$B$1" Then Worksheets("Pivot").PivotTables( _ "PivotTable1").PivotFields( _ "Month").CurrentPage = Target.Value -- Debra Dalgleish Contextures www.contextures.com/tiptech.html Blog: http://blog.contextures.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Worksheet Functions | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Discussion (Misc queries) | |||
sum a pivot table field as a calulated field | Excel Discussion (Misc queries) | |||
Pivit table- cell on spread sheet referencing pivot table field | Charts and Charting in Excel | |||
How to make a field created a part of the Pivot Table Field List? | Excel Discussion (Misc queries) |