![]() |
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 |
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 |
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 |
All times are GMT +1. The time now is 12:04 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com