Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Screen flickers while macro is running
Usually the code
Application.ScreenUpdating = False and Application.ScreenUpdating = True switches off and then switches on screen updating successfully without any problems. 'Private Sub Worksheet_Activate()' of a worksheet calls a macro in the Modules. This macro jumps between worksheets to gather information. The ScreenUpdating keeps the screen focused on the activated worksheet whilst the macro is running. Whilst the macros is running the active screen flickers. The macro does everything else asked of it. What is the code please to stop the screen from flickering. Many thanks -- Derek Dowle |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Screen flickers while macro is running
your code is probably activating sheets ....without seeing the code, this is
a guess . however, there's usually no need to activate sheets when updating data so worksheets("Sheet1").Activate range("A1").Copy worksheets("Sheet2").Activate range("A1").Pastespecial xlallvalues can be replaced by worksheets("Sheet1").range("A1").Copy worksheets("Sheet2").range("A1").Pastespecial xlallvalues "Derek Dowle" wrote in message ... Usually the code Application.ScreenUpdating = False and Application.ScreenUpdating = True switches off and then switches on screen updating successfully without any problems. 'Private Sub Worksheet_Activate()' of a worksheet calls a macro in the Modules. This macro jumps between worksheets to gather information. The ScreenUpdating keeps the screen focused on the activated worksheet whilst the macro is running. Whilst the macros is running the active screen flickers. The macro does everything else asked of it. What is the code please to stop the screen from flickering. Many thanks -- Derek Dowle |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Screen flickers while macro is running
I understand the macro is called from the activate event...try....
Application.EnableEvents = False Application.ScreenUpdating = False 'call macro Application.EnableEvents = True Application.ScreenUpdating = True -- If this post helps click Yes --------------- Jacob Skaria "Derek Dowle" wrote: Usually the code Application.ScreenUpdating = False and Application.ScreenUpdating = True switches off and then switches on screen updating successfully without any problems. 'Private Sub Worksheet_Activate()' of a worksheet calls a macro in the Modules. This macro jumps between worksheets to gather information. The ScreenUpdating keeps the screen focused on the activated worksheet whilst the macro is running. Whilst the macros is running the active screen flickers. The macro does everything else asked of it. What is the code please to stop the screen from flickering. Many thanks -- Derek Dowle |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Screen flickers while macro is running
Patrick
In a roundabout way you have provided the answer, thank you. I no longer get the flickering. It was not the answer I was expecting as I recollect having seen in the discussion group some years ago another way around the problem by putting a statement at the beginning and end of the code in a similar fashion to the 'screenupdating'. I should have made a note of it. My code was not as straight forward copy and paste. One sheet contained data and the macro manipulates the data and then uses it to populate cell comments on another sheet. When the focus is moved to this other sheet the comments automatically get updated via the Worksheet_Activate() sub. Gathering the data by looking at the data sheet rather than going to it solve the problem. -- Derek Dowle "Patrick Molloy" wrote: your code is probably activating sheets ....without seeing the code, this is a guess . however, there's usually no need to activate sheets when updating data so worksheets("Sheet1").Activate range("A1").Copy worksheets("Sheet2").Activate range("A1").Pastespecial xlallvalues can be replaced by worksheets("Sheet1").range("A1").Copy worksheets("Sheet2").range("A1").Pastespecial xlallvalues "Derek Dowle" wrote in message ... Usually the code Application.ScreenUpdating = False and Application.ScreenUpdating = True switches off and then switches on screen updating successfully without any problems. 'Private Sub Worksheet_Activate()' of a worksheet calls a macro in the Modules. This macro jumps between worksheets to gather information. The ScreenUpdating keeps the screen focused on the activated worksheet whilst the macro is running. Whilst the macros is running the active screen flickers. The macro does everything else asked of it. What is the code please to stop the screen from flickering. Many thanks -- Derek Dowle |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Screen flickers while macro is running
Jacob
As you will have seen by my reply to Patrick's helpful response I was expecting something different. I will make a proper record of your answer on this occaision. Thank you -- Derek Dowle "Jacob Skaria" wrote: I understand the macro is called from the activate event...try.... Application.EnableEvents = False Application.ScreenUpdating = False 'call macro Application.EnableEvents = True Application.ScreenUpdating = True -- If this post helps click Yes --------------- Jacob Skaria "Derek Dowle" wrote: Usually the code Application.ScreenUpdating = False and Application.ScreenUpdating = True switches off and then switches on screen updating successfully without any problems. 'Private Sub Worksheet_Activate()' of a worksheet calls a macro in the Modules. This macro jumps between worksheets to gather information. The ScreenUpdating keeps the screen focused on the activated worksheet whilst the macro is running. Whilst the macros is running the active screen flickers. The macro does everything else asked of it. What is the code please to stop the screen from flickering. Many thanks -- Derek Dowle |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Screen flickers and text disappears/moves?? | Excel Discussion (Misc queries) | |||
Screen Flickers and slows down worksheet functions | Excel Programming | |||
Display Problem in Excel 2007: Screen flickers an rows blanked out | Excel Discussion (Misc queries) | |||
Screen "Flickers" When macro Starts !! | Excel Programming | |||
Spreadsheet screen flickers for a few second when using a condition | Excel Programming |