Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Question on application.screenupdating

Hi,

Could someone tell what's the best practise one using screenupdating with
following situation:

One sub contains call to 4 to 5 others sub, of this 4 to 5, only 1 don't
write to sheet. Should I placed screenupdating to each sub or to the master
sub??

Right now, I coded screenupdating under the master sub, but I notice that
when I execute it, the screen flicker. SHould this happen??

Thanks
Regards
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Question on application.screenupdating

Hi Augusus,

Could someone tell what's the best practise one using screenupdating with
following situation:

One sub contains call to 4 to 5 others sub, of this 4 to 5, only 1 don't
write to sheet. Should I placed screenupdating to each sub or to the
master
sub??

Right now, I coded screenupdating under the master sub, but I notice that
when I execute it, the screen flicker. SHould this happen??



If ScreenUpdating is set to False in the first sub, this setting should
persist through the chained calls.

As a test, I ran Sub Main which calls a second sub which, in turn, calls a
third sub. To check the flicker issue, I included sheet selection and
multiple cell selections (1000) in each sub.

ScreenUpdating remained off through the calls and flicker did not appear
to pose a problem..

Sub Main()
Dim i As Long
With Application
.ScreenUpdating = False

Sheets(2).Select
For i = 1 To 1000
Cells(i, 1).Select
Next
One
MsgBox "On return to Main, ScreenUpdating = " & .ScreenUpdating
.ScreenUpdating = True
End With
End Sub

Sub One()
Dim i As Long

With Application
Sheets(1).Select
For i = 1 To 1000
Cells(i, 1).Select
Next
MsgBox "ScreenUpdating in One = " & .ScreenUpdating
Two
End With
End Sub

Sub Two()
Dim i As Long

With Application
Sheets(3).Select
For i = 1 To 1000
Cells(i, 1).Select
Next
MsgBox "ScreenUpdating in Two = " & .ScreenUpdating
End With
End Sub

Perhaps something in your code is restoring ScreenUpdating.

---
Regards,
Norman


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Question on application.screenupdating

There are somethings that turn on screenupdating.

If you pepper your code with:

Debug.print "step 1: " & application.screenupdating

then later...

Debug.print "step 2: " & application.screenupdating

(and a few(?) more!)

You should be able to find the line(s) that turn it back on. Then you can add
one more "application.screenupdating = false" right after that troublesome line
of code.



augustus wrote:

Hi,

Could someone tell what's the best practise one using screenupdating with
following situation:

One sub contains call to 4 to 5 others sub, of this 4 to 5, only 1 don't
write to sheet. Should I placed screenupdating to each sub or to the master
sub??

Right now, I coded screenupdating under the master sub, but I notice that
when I execute it, the screen flicker. SHould this happen??

Thanks
Regards


--

Dave Peterson
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
How to set Application.ScreenUpdating = False for Gen use David_Williams_PG () Excel Discussion (Misc queries) 1 August 15th 06 12:06 PM
Application.ScreenUpdating function question Fleone Excel Worksheet Functions 2 May 12th 05 01:36 AM
problem with Application.ScreenUpdating Betty[_2_] Excel Programming 8 July 23rd 04 09:51 PM
Application.ScreenUpdating malfunction Tom Deiley Excel Programming 1 June 18th 04 03:59 PM
Application.ScreenUpdating = False Pieter Kuyck Excel Programming 2 July 15th 03 06:28 PM


All times are GMT +1. The time now is 01:14 AM.

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"