Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Screen flickers and text disappears/moves?? G Excel Discussion (Misc queries) 10 March 31st 10 02:28 PM
Screen Flickers and slows down worksheet functions TG Excel Programming 5 January 14th 09 08:46 PM
Display Problem in Excel 2007: Screen flickers an rows blanked out OZL103 Excel Discussion (Misc queries) 2 June 23rd 08 05:23 PM
Screen "Flickers" When macro Starts !! monir Excel Programming 6 December 18th 07 07:29 PM
Spreadsheet screen flickers for a few second when using a condition wayne Excel Programming 5 January 25th 05 03:41 PM


All times are GMT +1. The time now is 10:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"