+ Reply to Thread
Results 1 to 7 of 7

Significance of resetting Application.Screenupdating to true

  1. #1
    Registered User
    Join Date
    12-24-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    99

    Question Significance of resetting Application.Screenupdating to true

    I have been looking for a more precise answer, why we need to reset Application.Screenupdating to true. I cant see a reference where it is clearly mentioned what is the significance of this statement and what it actually does. I only know that it has to be set back to true before we End the macro. It would be helpful if someone can explain this with an example code. Thanks!

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Significance of resetting Application.Screenupdating to true

    Hi Pavan,

    Below is what I found from Excel help:-

    Application.ScreenUpdating Property (Excel)

    True if screen updating is turned on. Read/write Boolean.

    Syntax

    expression.ScreenUpdating

    expression A variable that represents an Application object.

    Remarks
    Turn screen updating off to speed up your macro code. You won't be able to see what the macro is doing, but it will run faster.
    Remember to set the ScreenUpdating property back to True when your macro ends.

    Example
    This example demonstrates how turning off screen updating can make your code run faster. The example hides every other column on Sheet1, while keeping track of the time it takes to do so. The first time the example hides the columns, screen updating is turned on; the second time, screen updating is turned off. When you run this example, you can compare the respective running times, which are displayed in the message box.


    VBA
    Please Login or Register  to view this content.
    Hope this helps.


    Regards,
    DILIPandey
    <click on below * if this helps>
    Last edited by dilipandey; 12-25-2012 at 03:35 AM.
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Registered User
    Join Date
    12-24-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Significance of resetting Application.Screenupdating to true

    Thanks for the quick Reply Dilip! But this doesn't answer my question! I want to understand why is it always required to set Application.ScreenUpdating to true before we end a macro(as seen in the above code) and why can't we leave the macro with Application.ScreenUpdating set to false? How does it make any difference?

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Significance of resetting Application.Screenupdating to true

    see below c/o Tom Urtis (MS Excel MVP)

    http://www.atlaspm.com/toms-tutorial...rue-heres-why/

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Significance of resetting Application.Screenupdating to true

    if you turn it off at the beginning of code it makes sense to turn it back on
    you don't need to turn it on if you never turned it off in the first place.
    and having now read the article i now see the other reasons
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  6. #6
    Registered User
    Join Date
    12-24-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Significance of resetting Application.Screenupdating to true

    @DonkeyOte: Thanks a ton! I had come across this article earlier, my bad, i read it half way through and missed the important part! Now, it makes sense to me.

  7. #7
    Registered User
    Join Date
    12-24-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Significance of resetting Application.Screenupdating to true

    @martindwilson: Thanks for the reply! Yes, i do agree with you. But i want this functionality to be used to avoid screen flickering, I understand that its not required to be used in every macro that we create.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1