pivot field definition in VBA

G

Guest

How can I get VBA to figure out what is in position 1 or 2 or whatever of the
rows in a table? In other words, when I am recording a macro and, for
example, dragging out a row field, the recording takes the actual name of
that field and makes it invisible. But if I am in a situation where a user
is going to be manipulating this and I want Excel to automatically take out,
say, the second grouping of a table, without my knowing ahead of time what
that second grouping will be at the time the macro is run, then how do I tell
it "drag out whatever field is in position 2"?

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