+ Reply to Thread
Results 1 to 4 of 4

Help Needed with Screen Updating Code

  1. #1
    Registered User
    Join Date
    11-12-2018
    Location
    USA
    MS-Off Ver
    Microsoft Office 365
    Posts
    1

    Help Needed with Screen Updating Code

    I have written some code where it will turn on screen updating just long enough to input a text value into a cell that explains to the user what the current status is for the procedure. Once the status is inputted into the cell, I then the VBA turns off screen updating so that the rest of the procedure will run in the background. This is in order to help the code to run faster and to eliminate the screen from constantly flashing.

    Next, once the code gets to a certain spot in the procedure, the code will turn screen updating back on, input another status value into the next cell to show the user the latest status of the current procedure. After that cell is updated, screen updating is turned off again while additional steps are completed in the background.

    However, even though I am specifying code to turn on screen updating, enter the cell value with he status value and then turn off screen updating, I’m finding that the cells do not show the updated status value until after the entire code has finished running. Does anyone know why it doesn’t show the status as the cell value until the very end?

    Is it a speed thing where screen updating is set back to true, but because the code is running so fast, it does not update the screen in time for the inputted value to be displayed in the cell before screen updating is set back to false? If so, how would you recommend fixing it? I want the status to update the cells o that it can be seen by the user the moment it is updated, not at the very end. Thanks in advance.

  2. #2
    Forum Contributor
    Join Date
    10-01-2018
    Location
    Virginia Beach, VA
    MS-Off Ver
    365
    Posts
    129

    Re: Help Needed with Screen Updating Code

    Not sure, but as a debugging method, you could try adding
    Please Login or Register  to view this content.
    right before the line that turns screen updating back off, to force a pause. That way you could see if the value is being shown while screen updating is on. you could drop another one in after the next time you turn screen updating back off, to see if the timing of the MsgBox forced pause makes a difference in whether or not the value update can "outrun" the screen updating changes, perhaps?

    I'd ask if you could post a sample file, but I imagine without a substantially large data set, the full code would run too fast to see the issue you're experiencing...

  3. #3
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    419

    Re: Help Needed with Screen Updating Code

    Not sure if this will help, but it's what I would try first - try adding 'DoEvents' above the line where you turn screen updating back on.

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,908

    Re: Help Needed with Screen Updating Code

    Rory

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Excel 2016 screen flashing between two workbooks despite screen updating turned off
    By Cumberland in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-29-2016, 03:07 PM
  2. Screen Updating = False not working - need help to remove .select from code?
    By jaimelwilson in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-01-2014, 08:58 PM
  3. Replies: 4
    Last Post: 01-23-2014, 07:05 AM
  4. Screen Updating Off
    By manny_cb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-05-2010, 03:16 PM
  5. [SOLVED] Screen Updating
    By Ben in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-21-2005, 07:06 PM
  6. Screen Updating
    By Michael in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-14-2005, 06:06 PM
  7. Screen Updating
    By nidovan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-16-2005, 06:58 PM

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