Turn off screen updating in excel

Display Status Bar = True ''//Make sure that the statusbar is visible For i = 1 To i Max ''// imax is usually 30 or so fraction Done = CDbl(i) / CDbl(i Max) Application.Status Bar = Format(fraction Done, "0%") & " done..." ''// or, alternatively: ''// status Range.value = Format(fraction Done, "0%") & " done..." ''// Some code....... Display Status Bar = boo Status Bar State ''//Reset Status bar display setting Application.My Excel tool performs a long task, and I'm trying to be kind to the user by providing a progress report in the status bar, or in some cell in the sheet, as shown below.

For instance, any keys pressed while a function is running will be sent by Do Events The keyboard input will be processed before the screen is updated, so if you are changing cells on a spreadsheet by holding down one of the arrow keys on the keyboard, then the cell change event will keep firing before the main function finishes.A User Form will not be refreshed in some cases, because Do Events will fire the events; however, Repaint will update the User Form and the user will see the changes on the screen even when another event immediately follows the previous event.In the User Form code it is as simple as: This is not directly answering your question at all, but simply providing an alternative.As there is no command in Excel to refresh a worksheet in the way a user form can be refreshed, it is necessary to use a trick to force Excel to update the screen.The following commands seem to do the trick: Specifically, if you are dealing with a User Form, then you might try the Repaint method.

Leave a Reply