Excel VBA macros

VBA macros in Excel

 Excel macros

Download the best tutorial, website and reference tool on Excel

Lesson 2: VBA for Excel Code for Application

Application
Application is a VBA-object, IT IS EXCEL. Whenever you want Excel to do something or you want to change a property of Excel, you will use the object Application.

ScreenUpdating
When you don't want to see your screen follow the actions of your VBA procedure, you start and end your code with the following sentences:
Application.ScreenUpdating = False
Application.ScreenUpdating = True

Quit
The following line of code closes Excel altogether.
Application.Quit

CutCopyMode
After each Copy/Paste operation, you should empty the clipboard with the following line of code to make sure that the computer memory doesn't overload.
ActiveSheet.Paste
Application.CutCopyMode=False

 

GoTo
To select a certain cell you can use
Application.Goto Reference:=Range("V300")
or more simply
Range("V300").Select

But if you want this cell to be selected and be the top/left cell on your screen you will use
Application.Goto Reference:=Range("V300"), Scroll=True
 

Download the best tutorial, website and reference tool on Excel

 Excel VBA macros

VBA macros in Excel

 Excel macros

All rights reserved PLI Consultant Inc.