Pivot Table issue

P

Pedro

Hi
I have a pivot table and need to know which code should I write in order to
change a RowField by another on the database but, whithout knowing the
existing selected rowfield

Regards
Pedro
 
P

Pedro

I have in the Row Field "Segment Name" I want to write a code in order to
replace the field by "Currency" but whithout taking into account the name of
the existing. Next time I might have another field name and replace by
Currency
 
M

Mark Bigelow

This should do it:

' This variable tells which position the field is in
' First position is 0
intFieldPos = 0
ActiveSheet.PivotTables("PivotTable1").PivotFields(intFieldPos).Orientat
ion = _
xlHidden
With ActiveSheet.PivotTables("PivotTable1").PivotFields("Currency")
.Orientation = xlRowField
.Position = intFieldPos
End With

Let me know if this doesn't work.

Mark

---
Mark Bigelow
mjbigelow at hotmail dot com
http://hm.imperialoiltx.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 

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