Vba excel status bar not updating
(Basically, a UDF is allowed to return a value and that's it.) If you called that function from a piece of VBA code, it works OK, providing you change it to return a value such as: Function test Status Bar(delay As Long) As String Dim progress As Long For progress = 1 To delay Application.Status Bar = False test Status Bar = "Finished" End Function Sub test Status Bar(delay As Long) Dim progress As Long For progress = 1 To delay Application.Function test Status Bar(delay As Long) Dim progress As Long For progress = 1 To delay Application.Status Bar = "Progress: test ongoing ...." & (progress / delay) & "%" Do Events Next progress Application.Status Bar = False End Function Your function works fine, but I suspect that you are calling it as a UDF from an Excel cell.UDFs are not permitted to update the status bar, or make any other changes to the Excel environment.Caption = "" & tl Total Hour & " hours, " & tl Total Min & " minutes, " & tl Total & " seconds" 'Hide if finished If progress = max Progress Then Me.
You can use it to display the progress of a VBA procedure, or indicate that the procedure is complete.If we optimized our VBA Macro to the fullest there is often not much more you can do to change that.Usually what is irritating is waiting for VBA Macro code completion.Initialize "My title", 100 'Use the Progress Bar to track macro execution by running the For loop 100 times For i = 0 to 99 pb. Managing the expectations of you users is key to creating effective automations in Excel VBA.Be sure to also check out ways to enhance the performance of your VBA Macros.
Search for vba excel status bar not updating:
Does the status bar disappear from Microsoft Excel's window by accident?