excel pivot tables

T

tom

I posted this same query yesterday, but nobody had an
answer. not sure how far you guyts look back so i'll try
again!

help please


Excel 2000

I use a pivot table for a report that has to be sent out
in many different formats so I would like to record a
macro to do this for me.

Part of the formatting that has to be done is changing the
page, row and column pivot table fields. I have tried
recording a macro, but excel records the cell reference of
the pivot table field that i am moving. Obviously the
field are not aways ging to be in the same place.

Does anyone know the code i need to use that will select a
pivot table filed by its name and then move it, rahter
than by its cell reference.

any help woukld be much appreciated
 
B

Bernie Deitrick

Tom,

For example:

With ActiveSheet.PivotTables("PivotTable1")
With .PivotFields("QUARTER")
.Orientation = xlRowField
.Position = 1
End With
End With

HTH,
Bernie
Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top