Option Explicit Sub macro1() Dim i As Long, lrow As Long Application. After the macro is finished, the status bar will show as follows – So similarly, you can update the status bar at different parts of the code, so that the user knows what is happening as the macro is running. Here is a pic of the status bar while the macro is running. Once we use at the end of the code, it will revert to the default Excel message which is READY.If you want to learn more about Microsoft Excel VBA programming with userforms this is a great project series to learn from.
An and always in the code module of the worksheet, whenever the value of any cell on the worksheet is changed by user input or by other VBA code (but not if the change in value is a result of a formula calculation). The events and their procedure declarations are fixed.Events and Event Procedures were introduced in Excel97. Events and event procedures are the same for versions 97 through 2007.No significant changes have been made to the event model since its introduction in Excel97.You will have better success if you first understand how the application is pieced together. Clear Contents On Error Go To 0 Exit Sub Clear Data_Error: Msg Box "Error " & Err. Description & ") in procedure Clear Data of Module Filters" End Sub Sub Protect_All() Dim ws As Worksheet For Each ws In Active Workbook. Protect Password:="Online", Drawing Objects:=True, Contents:=True, Scenarios:=True _ , Allow Formatting Cells:=True, Allow Sorting:=True, Userinterfaceonly:=True Active Sheet. Make sure that all of these advanced filters have Unprotect_all and Protect_all code when they run.In this section we will be completing this project order and Inventory Management with Userforms. Advanced Filter Action:=xl Filter Copy, _ Criteria Range:=Sheet1. Enable Selection = xl Unlocked Cells Next ws End Sub Sub Unprotect_All() Dim I On Error Resume Next For I = 1 To Sheets. Unprotect Password:="Online" Next I On Error Go To 0 End Sub Private Sub Workbook_Open() On Error Resume Next Sheet1. Make sure that you check this because from now on every time you run an advanced filter your workbook will be protected and every time you open the workbook it will be protected.