Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default rearranging data

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!


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rearranging data RA Excel Discussion (Misc queries) 3 June 5th 09 07:11 PM
Rearranging DATA raj74 Excel Discussion (Misc queries) 6 April 12th 09 12:11 PM
Rearranging data Witold Excel Discussion (Misc queries) 6 May 15th 07 02:54 PM
rearranging data [email protected] Excel Worksheet Functions 4 April 4th 07 10:32 PM
Rearranging Data Help... Jambruins Excel Discussion (Misc queries) 0 February 22nd 05 03:31 PM


All times are GMT +1. The time now is 02:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"