A VBA add-in to quickly insert any of the sample code found on our site directly into the Visual Basic Editor, save your own frequently used code, and more!

This can mean that what should take a matter of 1 to 3 seconds, often takes a lot longer.

Free Excel Help One drawback with recorded macros in Excel is that the code produced is often very inefficient.

Use this code template as a starting point (the error handler ensures that these properties are turned back on at the end of the sub, even if it errors) Sub Your Sub() On Error Go To EH Application. Select Next i 'get results results = "Screen Updating not disabled: " & Format(Time - start Time, "hh:mm:ss") & " seconds" start Time = Time 'scenario 2 - screenupdating disabled Application.

Screen Updating = False 'swap between sheets 1/2 (need both sheets or this will crash) For i = 1 To numb Switches Sheets(1 (i Mod 2)). Screen Updating = True 'get results for part two results = results & vb Cr Lf & "Screen Updating IS disabled: " & Format(Time - start Time, "hh:mm:ss") & " seconds" 'show results Msg Box results End Sub Firstly I've been using the script written by Richie (UK) Post #7 Here It simply iterates through a loop changing the value of i in one cell.

The data is stored in 2 sheets (databases) and filtered to your criteria.

The purpose of this project is to help with your VBA and general Excel skills in basic application development.

Go to This Workbook and follow the instructions below.

To set the Userform timer change the number of seconds to the same amount as you set the progress bar in the Userform.

As a result, of all this selecting and scrolling, the screen flickers whenever your recorded macro is played back. Screen Updating Those that are familiar with VBA code may also be aware of the term Application. Unfortunately those that really need to know about this term (those that can only record macros) are often not aware of it.

By setting Screen Updating to False at the Start of the macro, you will not only stop the constant screen flickering associated with recorded macro, but also greatly speed up the execution of the macro.

Remove the apostrophe from in front of “Protect_all” this will allow all sheets to be protected when the workbook opens. To change the password put the curser in the “Unprotect_all” procedure and press the F5 key to run the procedure. Before you proceed check that the sheets are unprotected.