I have a large cell in sheet "main" containing several text controls. These are linked to named cells in sheet "Refs". There's a button in "main" that launches a VBA sub.
At the start, the sub does...
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.Calculation = xlCalculationManual
then it updates the cells behind the names in sheet "Refs" Each update is surrounded by
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
RefsSheet.Cells(row_downldstat, col_downldstat) = state
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
The VBA sub takes a while to finish so the idea is to provide feedback to the user as to what's going on. Unfortunately the text boxes are not updated until the VBA sub returns.
If I put the formula =Down_State in a cell on the "main" sheet I see it updated as the VBA routine runs. Down_State is the same cell as RefsSheet.Cells(row_downldstat, col_downldstat). I prefer NOT to use this method as there are several textboxes and the whole idea was to migrate from such a design.
Note that the textboxes are simply in a cell, not in a form.
I do know about the application.statusbar but that's not very noticeable.
How can I cause these text boxes to be updated while the VBA sub is active?
DoEvents
after you update theDown_State
cell so that excel gets time to update the textbox. – Siddharth Rout