PDA

View Full Version : Avoid flickering in excel



Excelfun
05-01-2012, 10:02 PM
Hi

when i open the workbook the excel workbook display start flickering for nearly about 9 seconds then it stops. I dont understand the reason.
in a workbook the code written for worksheet event change ; workbook open event and in standard module.

How can i avoid the flickering in excel ? Please help to shrink the code as well. I will appreciate any help on this.

below code is in thisworkbook module


Private Sub Workbook_Open()
On Error Resume Next
Application.DisplayAlerts = False: Application.ScreenUpdating = False: Application.Calculation = xlCalculationManual
Call eset
Call work
On Error Resume Next
Range("K10").MergeArea.ClearContents
Range("K12").MergeArea.ClearContents
Union(Range("M32:M35"), Range("O32:O35"), Range("Q32:Q35"), Range("S32:S35"), Range("K40"), Range("S40"), Range("O42"),
Range("M49").MergeArea.ClearContents
Application.DisplayAlerts = True: Application.ScreenUpdating = True: Application.Calculation = xlCalculationAutomatic
On Error GoTo 0
End Sub

below code is in sheet1 module

Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Application.DisplayAlerts = False: Application.ScreenUpdating = False: Application.Calculation = xlCalculationManual
Dim R1
If Target.Address = "$A$10" And Len(Range("$A$10")) < 3 Then
R1 = MsgBox("Name must be more then 3 Character : Calculated " & Len(Range("$A$10")), vbOKOnly, "Warning")
End If
Dim R
If Target.Address = "$K$18" Then
R = MsgBox("Refresh Plan Details", vbYesNo, "CONFIRM")
If R = vbYes Then
Call work
Call Monitor
Call eset
Range("K22").MergeArea.ClearContents
Range("K24").MergeArea.ClearContents
Union(Range("M32:M35"), Range("O32:O35"), Range("Q32:Q35"), Range("S32:S35"), Range("K40"), Range("S40"), Range("O42"), Range("M77:M85")).ClearContents
Sheet1.Select
End If
End If
If Target.Address = "$K$24" Then
Call Temp
End If
Application.DisplayAlerts = True: Application.ScreenUpdating = True: Application.Calculation = xlCalculationAutomatic
On Error GoTo 0
End Sub

Admin
05-01-2012, 10:14 PM
Hi,

have a look at this: http://www.excelfox.com/forum/f2/application-screenupdating-%3D-false-not-working-177/

Excelfun
05-17-2012, 07:58 AM
Hi Admin

Thanks...!
it do reduce flickering. but i do changes in code like instead of using lot of IF-Else condition i use case statement with If - Else and now its working fine for me.

Admin
05-17-2012, 09:37 AM
Thanks for the feedback :cheers: