Results 1 to 5 of 5

Mouse flickers when I run VBA code

Threaded View

  1. #1
    Registered User
    Join Date
    12-21-2016
    Location
    London
    MS-Off Ver
    2013
    Posts
    3

    Mouse flickers when I run VBA code

    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
    Last edited by purplerayne; 12-21-2016 at 08:11 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Screen Flickers Even with Application.ScreenUpdating set to False
    By m3atball in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 08-26-2017, 11:42 AM
  2. Launching a saved bat file using VBA - CMD prompt flickers but doesn't run
    By PFDave in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-28-2016, 06:01 AM
  3. Userform flickers
    By sbe70 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-29-2012, 09:40 AM
  4. Code for mouse-overs?
    By IanWade in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-06-2011, 05:06 AM
  5. While Sorting - Screen Flickers
    By Ranjani in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-02-2009, 03:18 AM
  6. On Mouse On - With VBA Code
    By Naceur in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-30-2005, 06:44 PM
  7. Spreadsheet screen flickers for a few second when using a condition
    By wayne in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-25-2005, 12:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1