AndrosoSabroso
New Member
- Joined
- Oct 8, 2023
- Messages
- 2
- Office Version
- 2013
- Platform
- Windows
Hi! I am trying to get a single macro to show and hide a data field in a pivot table.
The code I am currently using is the following:
If Sheets("Test").PivotTables("Testeo").PivotFields("Comercial").Orientation = xlRowField Then
ActiveSheet.PivotTables("Testeo").PivotFields("Suma de Comercial").Orientation = xlHidden
Else
Sheets("Test").PivotTables("Testeo").PivotFields("Comercial").Orientation = xlDataField
End If
It seems like the condition is not working properly, could you guys helo me out¿
The code I am currently using is the following:
If Sheets("Test").PivotTables("Testeo").PivotFields("Comercial").Orientation = xlRowField Then
ActiveSheet.PivotTables("Testeo").PivotFields("Suma de Comercial").Orientation = xlHidden
Else
Sheets("Test").PivotTables("Testeo").PivotFields("Comercial").Orientation = xlDataField
End If
It seems like the condition is not working properly, could you guys helo me out¿