I have disabled screenupdating but the mouse still flickers, any ideas?
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
Application.ScreenUpdating = False
Sheets("Sheet2").Select
Sheets("Sheet3").Visible = True
Sheets("Sheet3").Select
On Error Resume Next
ActiveSheet.ShowAllData
ActiveSheet.ListObjects("Table25").Range.AutoFilter Field:=15, Criteria1:= _
"Ok"
Sheets("Sheet3").Select
ActiveWindow.SelectedSheets.Visible = False
Sheets("Sheet2").Select
ActiveSheet.ChartObjects("Chart 9").Activate
ActiveChart.SetElement (msoElementDataLabelNone)
ActiveChart.SetElement (msoElementDataLabelCenter)
ActiveSheet.ChartObjects("Chart 9").Activate
ActiveChart.FullSeriesCollection(1).DataLabels.Select
Selection.Format.TextFrame2.TextRange.Font.Bold = msoTrue
With Selection.Format.TextFrame2.TextRange.Font.Fill
.Visible = msoTrue
.ForeColor.ObjectThemeColor = msoThemeColorBackground1
.ForeColor.TintAndShade = 0
.ForeColor.Brightness = 0
.Transparency = 0
.Solid
End With
With Selection.Format.TextFrame2.TextRange.Font
.NameComplexScript = "Century Gothic"
.NameFarEast = "Century Gothic"
.Name = "Century Gothic"
End With
Selection.NumberFormat = "#,##0"
ActiveChart.FullSeriesCollection(2).DataLabels.Select
Selection.Format.TextFrame2.TextRange.Font.Bold = msoTrue
With Selection.Format.TextFrame2.TextRange.Font.Fill
.Visible = msoTrue
.ForeColor.ObjectThemeColor = msoThemeColorBackground1
.ForeColor.TintAndShade = 0
.ForeColor.Brightness = 0
.Transparency = 0
.Solid
End With
With Selection.Format.TextFrame2.TextRange.Font
.NameComplexScript = "Century Gothic"
.NameFarEast = "Century Gothic"
.Name = "Century Gothic"
End With
Selection.NumberFormat = "#,##0"
ActiveChart.FullSeriesCollection(3).DataLabels.Select
Selection.Format.TextFrame2.TextRange.Font.Bold = msoTrue
With Selection.Format.TextFrame2.TextRange.Font.Fill
.Visible = msoTrue
.ForeColor.ObjectThemeColor = msoThemeColorBackground1
.ForeColor.TintAndShade = 0
.ForeColor.Brightness = 0
.Transparency = 0
.Solid
End With
With Selection.Format.TextFrame2.TextRange.Font
.NameComplexScript = "Century Gothic"
.NameFarEast = "Century Gothic"
.Name = "Century Gothic"
End With
Selection.NumberFormat = "#,##0"
ActiveChart.FullSeriesCollection(4).DataLabels.Select
Selection.Format.TextFrame2.TextRange.Font.Bold = msoTrue
With Selection.Format.TextFrame2.TextRange.Font.Fill
.Visible = msoTrue
.ForeColor.ObjectThemeColor = msoThemeColorBackground1
.ForeColor.TintAndShade = 0
.ForeColor.Brightness = 0
.Transparency = 0
.Solid
End With
With Selection.Format.TextFrame2.TextRange.Font
.NameComplexScript = "Century Gothic"
.NameFarEast = "Century Gothic"
.Name = "Century Gothic"
End With
Selection.NumberFormat = "#,##0"
'remove labels with 0%**************************************************
Dim iPts As Integer
Dim nPts As Integer
Dim aVals As Variant
Dim srs As Series
ActiveSheet.ChartObjects("Chart 9").Activate
For Each srs In ActiveChart.SeriesCollection
With srs
If .HasDataLabels Then
nPts = .Points.Count
aVals = .Values
For iPts = 1 To nPts
If aVals(iPts) < 0.01 Then
.Points(iPts).HasDataLabel = False
End If
Next
End If
End With
Next
Application.ScreenUpdating = True
End Sub
Bookmarks