ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   pivot field description in VBA (https://www.excelbanter.com/excel-programming/331963-pivot-field-description-vba.html)

BorisS

pivot field description in VBA
 
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.
--
Boris

Roger Whitehead

pivot field description in VBA
 
Boris, try:

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


--
HTH
Roger
Shaftesbury (UK)




"BorisS" wrote in message
...
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.
--
Boris





All times are GMT +1. The time now is 12:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com