pivot field description in VBA

G

Guest

Okay, tried this before, but don't think it was understood.

I need VBA to look at a table ("SalesPvt"). Whatever is in the second row
grouping position, I need to make invisible. I effectively need to "swap
out" field names into the row position 1. I intend to do it in this order in
VBA:

1) make field name X (this will be entered by user in a cell, and then used
in VBA) and put into position 1.
2) take WHATEVER is now in position 2 (since adding a position 1 using VBA
just slides whatever was in 1 over to the 2nd slot) and hide it.

I know how to get (1) done. I don't know how to tell VBA to take position 2
and effectively "drag" it out of the table. If someone can help me out,
would be great.

Thx.
 
R

Roger Whitehead

Boris, try:

ActiveSheet.PivotTables("SalesPvt").ColumnFields(2).Orientation = xlHidden
 

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