cancel
Showing results for 
Search instead for 
Did you mean: 

deleting pivot table field

varshakanthikar
Level 3
I want to delete one pivot fields from value field.

Is their any code available for this

------------------------------
varsha kanthikar Senior Software engineer
Senior Software Engineer
persistent systems limited
Indiana
7517645366
------------------------------
2 REPLIES 2

PabloSarabia
Level 11
Hi!

Sorry, can yo please give us some information? Witch wich kind of object are you working for?

Bye 🙂

------------------------------
Pablo Sarabia
Architect
Altamira Assets Management
Madrid
634726270
------------------------------

AndreyKudinov
Level 10
I assume you want to do it in excel, although you dont mention it anywhere.

If you record a macro and check what excel does when you remove a field, you get something like this:
Dim xlInstance = GetInstance(handle)
Dim xlWorkbook As Object = GetWorkbook(handle, workbookname)
xlWorkbook.ActiveSheet.PivotTables(pivotname).PivotFields(pivotfield).Orientation = xlHidden

You can add this as new action to excel VBO. Assuming you know "pivotname", Otherwise you could probably use index or add some code to find pivotname.

------------------------------
Andrey Kudinov
Project Manager
MobileTelesystems PJSC
Europe/Moscow
------------------------------