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.
Example:
Application.ScreenUpdating = True
Worksheets(“Sheet1”).Range(“A1”).Value = “Process ABC started”
Application.ScreenUpdating = False
‘More code here runs through a procedure to replace various cell values with another value based on specific criteria. it runs through a loop until it reach Wend… Then the next cells A2 and A3 as shown below are updated with the latest status…
Application.ScreenUpdating = True
Worksheets(“Sheet1”).Range(“A2”).Value = “Process ABC finished”
Worksheets(“Sheet1”).Range(“A3”).Value = “Process DEF started”
Application.ScreenUpdating = False
‘More code here runs through a procedure to replace various cell values with another value based on specific criteria. it runs through a loop until it reach Wend… Then the next cells A3 and A4 as shown below are updated with the latest status…
Application.ScreenUpdating = True
Worksheets(“Sheet1”).Range(“A3”).Value = “Process DEF finished”
Worksheets(“Sheet1”).Range(“A4”).Value = “Process GHI started”
Application.ScreenUpdating = False
‘More code here runs through a procedure to replace various cell values with another value based on specific criteria. it runs through a loop until it reach Wend… Then the next cell A4 as shown below is updated with the latest status…
Application.ScreenUpdating = True
Worksheets(“Sheet1”).Range(“A4”).Value = “Process GHI finished”
‘and so on…
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.
Example:
Application.ScreenUpdating = True
Worksheets(“Sheet1”).Range(“A1”).Value = “Process ABC started”
Application.ScreenUpdating = False
‘More code here runs through a procedure to replace various cell values with another value based on specific criteria. it runs through a loop until it reach Wend… Then the next cells A2 and A3 as shown below are updated with the latest status…
Application.ScreenUpdating = True
Worksheets(“Sheet1”).Range(“A2”).Value = “Process ABC finished”
Worksheets(“Sheet1”).Range(“A3”).Value = “Process DEF started”
Application.ScreenUpdating = False
‘More code here runs through a procedure to replace various cell values with another value based on specific criteria. it runs through a loop until it reach Wend… Then the next cells A3 and A4 as shown below are updated with the latest status…
Application.ScreenUpdating = True
Worksheets(“Sheet1”).Range(“A3”).Value = “Process DEF finished”
Worksheets(“Sheet1”).Range(“A4”).Value = “Process GHI started”
Application.ScreenUpdating = False
‘More code here runs through a procedure to replace various cell values with another value based on specific criteria. it runs through a loop until it reach Wend… Then the next cell A4 as shown below is updated with the latest status…
Application.ScreenUpdating = True
Worksheets(“Sheet1”).Range(“A4”).Value = “Process GHI finished”
‘and so on…