SandsB
Well-known Member
- Joined
- Feb 13, 2007
- Messages
- 736
- Office Version
- 365
- Platform
- Windows
I have a pivot table that provides an average number of days for each of 2 fields. I want my chart to show one as a Line and the other as column. When I run a macro that refreshes the data and chart, the one I want to be a line is a column and vice versa. It's an easy manual change but I have to do it every time I update my data. Why is that? There's some crap in here because I created this macro by recording.
Sheets("Len").Select
' With ActiveSheet.PivotTables("PivotTable31").PivotFields("P Date")
' .PivotItems("(blank)").Visible = True
' End With
Range("A6").Select
ActiveSheet.PivotTables("PivotTable31").PivotCache.Refresh
With ActiveSheet.PivotTables("PivotTable31").PivotFields("P Date")
.PivotItems("(blank)").Visible = False
End With
Range("A8").Select
ActiveSheet.PivotTables("PivotTable31").PivotCache.Refresh
Sheets("Len").Select
' With ActiveSheet.PivotTables("PivotTable31").PivotFields("P Date")
' .PivotItems("(blank)").Visible = True
' End With
Range("A6").Select
ActiveSheet.PivotTables("PivotTable31").PivotCache.Refresh
With ActiveSheet.PivotTables("PivotTable31").PivotFields("P Date")
.PivotItems("(blank)").Visible = False
End With
Range("A8").Select
ActiveSheet.PivotTables("PivotTable31").PivotCache.Refresh