Hello,
I am having some VBA trouble getting a double column removed from a pivot table. I have 2 columns like this:
Sum of NOV 2016 and Sum of NOV 2016_2. Sometimes I get a double month, so the content can vary, but the "_" is the constant.
I would like to get rid of this second column.
My code reads:
With Selection.PivotTable
Cells.Find(What:="_", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh
ActiveCell.Orientation = xlHidden
End With
but that doesn't work. Is there some easy trick?
I am having some VBA trouble getting a double column removed from a pivot table. I have 2 columns like this:
Sum of NOV 2016 and Sum of NOV 2016_2. Sometimes I get a double month, so the content can vary, but the "_" is the constant.
I would like to get rid of this second column.
My code reads:
With Selection.PivotTable
Cells.Find(What:="_", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh
ActiveCell.Orientation = xlHidden
End With
but that doesn't work. Is there some easy trick?