Home |
Search |
Today's Posts |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Mark -
In my example of a few posts ago, I added the county and state as column fields, not data fields. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ Mark Roach wrote: Nice idea, Jon. How would the following be modified to show the state and county rather than count them? Sub Macro2() ' ' Macro2 Macro ' Macro recorded 12/19/2004 by Mark Roach ' ' ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _ "Sheet1!R3C1:R11C7").CreatePivotTable TableDestination:="", TableName:= _ "PivotTable2", DefaultVersion:=xlPivotTableVersion10 ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1) ActiveSheet.Cells(3, 1).Select With ActiveSheet.PivotTables("PivotTable2") .ColumnGrand = False .RowGrand = False End With ActiveSheet.PivotTables("PivotTable2").AddFields RowFields:=Array("ZONE", _ "Data"), ColumnFields:="WELL" With ActiveSheet.PivotTables("PivotTable2").PivotFields ("COUNTY") .Orientation = xlDataField .Position = 1 End With With ActiveSheet.PivotTables("PivotTable2").PivotFields ("STATE") .Orientation = xlDataField .Position = 2 End With With ActiveSheet.PivotTables("PivotTable2").PivotFields ("DEPTH") .Orientation = xlDataField .Position = 3 End With ActiveSheet.PivotTables("PivotTable2").PivotFields ("POROSITY").Orientati on = _ xlDataField End Sub Mark Roach Vice President Technical Resources The Oil & Gas Asset Clearinghouse Houston, Texas *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Rearranging data | Excel Discussion (Misc queries) | |||
Rearranging DATA | Excel Discussion (Misc queries) | |||
Rearranging data | Excel Discussion (Misc queries) | |||
rearranging data | Excel Worksheet Functions | |||
Rearranging Data Help... | Excel Discussion (Misc queries) |