I have a pivot like this.
Now I need to remove subtotals under project name column but should have subtotals for bill type column how to get it can someone help me with this.
All answers are appreciated! thank you in advance
Pivot tables are really hard to manipulate, I normally use LLM models support to get some VBA codes that helps me with those data manipulation. Here is one example created by LLM
Sub RemoveProjectNameSubtotals()
Dim pt As PivotTable
Dim pf As PivotField
' Specify the name of your pivot table
Set pt = ThisWorkbook.Sheets("Sheet1").PivotTables("PivotTable1")
' Specify the name of the field for which subtotals should be removed (Project Name)
Set pf = pt.PivotFields("Project Name")
' Set the Subtotals property to False to remove subtotals for the specified field
pf.Subtotals = Array(False, False, False, False, False, False, False, False, False, False, False, False)
' Specify the name of the field for which subtotals should be retained (Bill Type)
Set pf = pt.PivotFields("Bill Type")
' Set the Subtotals property to True to retain subtotals for the specified field
pf.Subtotals = Array(True, True, True, True, True, True, True, True, True, True, True, True)
End Sub
To use those VBA codes just create a text file and use the Invoke VBA Code activity, pass the txt file path and the method name, for the above example will be
RemoveProjectNameSubtotals
Hope this gives you a good approach, Regards!
thank you but it didn’t work!
To be more clear on the question, Are those blue color highlighted once subtotals?
Can you read this table using a Read range activity and Write the extracted table into a new excel and share here to see how these values are extracted as raw?
The once with total as suffix are subtotals .this pivot is extarcted from a global data sheet
This is a bit confidential data so can’t share it