ScreenUpdating Property of Application Object VBA

ScreenUpdating Application Property in VBA is used to turn ON/OFF screen updating. If we set ScreenUpdating property to TRUE then it turns on the screen updating else turn off the screen updating. When we set ScreenUpdating property of an application object to false then it will speed up the macro. It’s one of the optimizing technic.

PREMIUM TEMPLATES LIMITED TIME OFFER

ON SALE80% OFF

50+ Project Management Templates Pack
Excel PowerPoint Word

Advanced Project Plan & Portfolio Template
Excel Template

Business Presentations Templates Pack
PowerPoint Slides

20+ Excel Project Management Pack
Excel Templates

20+ PowerPoint Project Management Pack
PowerPoint Templates

10+ MS Word Project Management Pack
Word Templates


VBA ScreenUpdating Application Property – Syntax

Here syntax for ScreenUpdating Property of application object in VBA.

Application. ScreenUpdating

Where ScreenUpdating as Boolean datatype.
In the above syntax Application represents object and ScreenUpdating is the Property of Application object.

VBA ScreenUpdating Application Property: Example 1

Please find the below example for ScreenUpdating Property of an application object in excel VBA.

Sub Appl_ScreenUpdating1() 
‘Variable declaration 
Dim I As Integer
For I = 1 To 100
Sheets("Sheet1").Cells(I, 1) = I
Next 
End Sub

Explanation: In the above example, it will display numbers from 1 to 100 in the first column on Sheet1. We can notice the screen updating while updating Sheet1.

VBA ScreenUpdating Application Property: Example 1

Please find the below example for ScreenUpdating Property of application object in excel VBA.

Sub Appl_ScreenUpdating2()
Application.ScreenUpdating = False
Dim I As Integer
For I = 1 To 100
Sheets("Sheet1").Cells(I, 1) = I
Next
Application.ScreenUpdating = True
End Sub

Explanation: In the above example, it will display numbers from 1 to 100 in the first column on Sheet1. We can observe that there is no screen updating till running the macro. Don’t forget to reset the ScreenUpdating valsue as TRUE at the end of the macro.

VBA ScreenUpdating Application Property – Instructions

Please follow the below steps to execute the VBA code to save the excel file.
Step 1: Open any existing Excel Application.
Step 2: Press Alt+F11 – This will open the VBA Editor.
Step 3: Insert a code module from then insert menu.
Step 4: Copy the above code and paste in the code module which have inserted in the above step.
Step 5: Now press F5 to execute the code and observe when ScreenUpdating is ON and OFF.

LIMITED TIME OFFER

Leave A Comment


Related pages


macro to delete duplicate rows in excelactive range vbavba unprotect worksheetchange the row height in excelworking with excel macrosadvanced vba coursesql basic interview questions and answersexcel comparison operatorsprotect sheet in excelrunning macro in excelhow to prepare dashboard in excel 2007nested if in vbscriptmacro basics excelvba vlookup exampleprogramming excel vbaexcel startup macrosas miner tutorialcase statement excelmacro basics excel 2007make pivot table in excelcombobox vba codehow to delete excel columnssumifs function in excel 2013delete vbahow to protect excel worksheet with passwordvba textbox valuevlookup formula in excel 2010 with examplems access vba run queryvlookup tutorialloop excel vbavariables vbasumif on excelexcel vlookup nahow to unhide a tab in excel 2010microsoft word macro examplesvba switch casevba connection string to access databaseexcel macro repeatlearn excel macros step by stepexcel vba if statement multiple conditionsistext excelhow to insert combobox in excelexcel vba internet explorerexcel shortcut to insert rowexport data from access to excel using vbavba worksheetexcel macro merge cellsvba connect to oraclehow to merge and center cells in excel 2010remove duplicates in excelunhide all rowscase vba accesshow to unhide cells in excel 2010scripting.filesystemobject delete fileexcel sumifs functionvba cells functionexcel bubble chartsunprotect an excel worksheetcells worksheetsexcel vba userform tutorialexcel vba color codesexcel if cell contains textexcel expert tutorialcells in vbafind last row in excel vba3d cluster chart excelvba code samplesuser input in vbams vba tutorialexcel 2007 chart templatestypes of excel graphsexample of excel formulasddl dml dcl commands in sql serveradvanced vlookup exceldynamic charts excellock excel document