XLA routines: EE_PivotRemoveFields
Use EE_PivotRemoveFields to remove fields from a pivot table
Sub EE_PivotRemoveFields(pt As PivotTable, FieldsArrayOrRange) Dim intFld As Integer Dim arr 'http://excelexperts.com/xla-routines-eePivotRemoveFields for updates on this sub routine Select Case TypeName(FieldsArrayOrRange) Case "Variant()", "String" arr = FieldsArrayOrRange Case "Range" If FieldsArrayOrRange.Cells.Count = 1 Then ReDim arr(0) arr(0) = FieldsArrayOrRange Else arr = Application.Transpose(FieldsArrayOrRange) End If Case Else End Select For intFld = UBound(arr) To LBound(arr) Step -1 pt.PivotFields(arr(intFld)).Orientation = xlHidden Next intFld Erase arr End Sub
»
- Nick's blog
- Login or register to post comments
- 2772 reads
Recent comments
5 years 34 weeks ago
6 years 20 weeks ago
6 years 32 weeks ago
6 years 35 weeks ago
6 years 36 weeks ago
6 years 42 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago