Screen flashing
I have a macro that performs a certain set of tasks every second. Annoyingly
it also makes my screen flash every second, despite screen updating being set to false during activity. I'd be grateful for any observations anyone might have on this... Many thanks tp Sub TimerProc(ByVal hWnd As Long, ByVal uMsg As Long, _ ByVal nIDEvent As Long, ByVal dwTimer As Long) ' Application.ScreenUpdating = False 'On Error GoTo error_stop With Sheets("WMP").Range("BL4:bx64") .Replace What:="=", Replacement:="$$$=", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False End With With Sheets("Sheet1") Range("Y3:AA53").Select ActiveWorkbook.XmlMaps("java_Map").DataBinding.Ref resh End With With Sheets("WMP").Range("a5:m5") .Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove Application.CutCopyMode = False End With With Sheets("WMP").Range("a4:m4") .Copy End With With Sheets("WMP").Range("a5:m5") .PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False End With With Sheets("WMP").Range("BL4:bx64") .Replace What:="$$$=", Replacement:="=", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False End With If Sheets("WMP").Range("AM1") < Sheets("WMP").Range("AS1") Then With Sheets("WMP").Range("AS1") .Copy End With With Sheets("WMP").Range("AM1") .PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False End With End If Range("AQ1").Select Application.ScreenUpdating = True Exit Sub error_stop: Call EndTimer End Sub Sub StartTimer() TimerSeconds = 1 ' how often to "pop" the timer. TimerID = SetTimer(0&, 0&, TimerSeconds * 1000&, AddressOf TimerProc) End Sub Sub EndTimer() KillTimer 0&, TimerID End Sub |
All times are GMT +1. The time now is 08:43 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com