Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a button that creates a pivot chart and table. The data consists of
0's and 1's. This is the code I am using ... With ActiveChart.PivotLayout.PivotFields("0") .Orientation = xlRowField .Position = 1 End With With ActiveChart.PivotLayout.PivotFields("0") .Orientation = xlDataField .Position = 1 End With ActiveChart.PivotLayout.PivotFields("0").Caption = "Types of Reports" The problem is that the first cell has to show "0" for the macro to work. Our data could start with "1". How do I make the "0" in parenthesis different so that it grabs the first cell content as the first field for the pivot chart and table. Help!! -- LizW |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yeah, instead of using "0" or "1", if you can get by with just having the
first item, and all other pivottable work falls out from there, then you can use the first item of the list instead of expecting it to be "0", it will be whatever it will be. :) With ActiveChart.PivotLayout.PivotFields(1) Then if you need to step through all pivotfields, you can nest this in a loop such that for XYZ = 1 to ActiveChart.PivotLayout.PivotFields.Count Next XYZ "LizW" wrote: I have a button that creates a pivot chart and table. The data consists of 0's and 1's. This is the code I am using ... With ActiveChart.PivotLayout.PivotFields("0") .Orientation = xlRowField .Position = 1 End With With ActiveChart.PivotLayout.PivotFields("0") .Orientation = xlDataField .Position = 1 End With ActiveChart.PivotLayout.PivotFields("0").Caption = "Types of Reports" The problem is that the first cell has to show "0" for the macro to work. Our data could start with "1". How do I make the "0" in parenthesis different so that it grabs the first cell content as the first field for the pivot chart and table. Help!! -- LizW |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Pivot Tables to Charts | Charts and Charting in Excel | |||
Pivot charts & tables | Charts and Charting in Excel | |||
Pivot tables Charts | Excel Discussion (Misc queries) | |||
Pivot Tables and Charts | Charts and Charting in Excel | |||
Pivot Charts / Tables | Excel Worksheet Functions |