![]() Now you can smartly get information on the status bar using VBA of Excel 2016, 2013, 20 using this one-liner.Ĭertain vba macros / codes take a long time to run or execute the actions required. Otherwise, the user may think that the system has hanged or something. When your code goes through multiple stages or runs a long loop, you can show that on status bar so that user knows the code is running. The status bar messages are quite useful to display messages while working with lengthy code. I did it before all function calls and in the end, I set the status bar to blank (“”). Now, before calling the function_1, I am displaying a message that is calling function one.Īpplication.Wait (Now + TimeValue("00:00:2")) this line of code is just to fake a lengthy function call so that I get 2 seconds to see this on my status bar. In this example, the screen updating is set False in the beginning. Sub DisplayMessageOnStatusBar()Īpplication.StatusBar = "Calling function one "Īpplication.Wait (Now + TimeValue("00:00:2"))Īpplication.StatusBar = "Calling function two"Īpplication.StatusBar = "Calling function Three" In this example, I am just showing which function is running. StatusBar is a property of Application object that takes text as input. VBA Code to display messages on Status Bar of Excel Application.StatusBar = "Message" You can display stages of your Marco on the status bar or use it as progress bar. You can use a status bar of excel to get information from Excel without interfering execution of code. If you don’t know where is the status bar in excel, here it is: But due to this, you don’t get to know what is going on in your code. When your VBA code is lengthy and you do several tasks using VBA, you often disable the screen update so that you don’t see that screen flickering. ![]() The status bar in excel can be used as a code monitor.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |