Hello All,

New to the forum and new to VB. I am creating a basic macro and need some help with getting the pivot to display some things correctly.

Below is an example of my script so far:

Sub CreatePivot()
' Pvt Table IP by Order
Dim objTable As PivotTable, objField As PivotField
ActiveWorkbook.Sheets("2012 DEC YTD FLK INPT DATA").Select
Range("A1").Select

Set objTable = Sheet1.PivotTableWizard
ActiveSheet.Name = "Pvt Table IP by Order"

Set objField = objTable.PivotFields("ORDER")
objField.Orientation = xlRowField

Set objField = objTable.PivotFields("DISCH QTR")
objField.Orientation = xlPageField

Set objField = objTable.PivotFields("CASES")
objField.Orientation = xlDataField
objField.Function = xlSum
objField.NumberFormat = "$ #,##0"

..(Continue adding DataFields)...etc...

Question 1. When I run the macro it sums by RowField when I would like it sum by ColumnField. What do I need to add in my script to get that to work?

Question 2. In regards to xlPageField... How can I specifically make a QTR selection? (.Position?). My goal is to use create 4 tabs (1 for each quarter). Currently this just shows the dropdown with ALL being checked vs. a particular QTR being selected.

Hope my questions are clear, and thanks in advance!

~Evan