Excel VB A Quick Reference
Excel VB A Quick Reference
Declare variables
1.
2.
3.
4.
5.
Dim
Procedure variable
Static
Private
Module variable
Public
Declare procedures
Private
Function
Public
Function
Private
Sub
Public Sub
Decision Structures
VBA terms
Object ............. Noun
Property .......... Adjective
Method ........... Verb
Argument........ Adverb
If Condition1 Then
statement(s)
ElseIf Condition2 Then
statement(s)
Else
statement(s)
End If
Select Case Variable
Case expression1
statement(s)
Case expression2
statement(s)
Case else
statement(s)
End Select
Boolean
byt
Byte
0 and 255
int
Integer
lng
Long
sng
Single
Up to 7 decimal places
dbl
Double
Up to 15 decimal places
cur
Currency
dtm
Date /
Time
1/1/0100 to 12/31/9999
00:00:00 and 23:59:59
str
String
wkb
Workbook
A workbook
Do
wks
Worksheet
A worksheet
rng
Range
Loop Structures
For counter = Start to Stop Step Increment
Statement(s)
Next counter
For Each object variable in collection
Statement(s)
Next
Statement(s)
Loop While | Until condition
Page 1
www.TheTechMentors.com
408.375.6190
Properties
Methods
Events
Workbook
Worksheet
Range
ActiveChart
ActiveSheet
AutoUpdateFrequency
Charts
FileFormat
FullName
HasPassword
HasVBAProject
Name
Names
Path
ReadOnly
Saved
Sheets
Worksheets
AutoFilter
Cells
CircularReference
Columns
Comments
Count
DisplayPageBreaks
EnableAutoFilter
Hyperlinks
Name
Names
PageSetup
Parent
Range
Rows
Shapes
Sort
StandardHeight
StandardWidth
Visible
AddIndent
Address
AllowEdit
Borders
Cells
Characters
Column
Columns
ColumnWidth
Comment
Count
CurrentRegion
Dependents
End
EntireColumn
EntireRow
Font
Formula
FormulaR1C1
HasFormula
Height
Hidden
Horizontal
Alignment
Hyperlinks
IndentLevel
Interior
Item
Locked
MergeArea
MergeCells
Name
NumberFormat
Offset
Orientation
OutlineLevel
PageBreak
Parent
PivotCell
PivotField
PivotItem
PivotTable
Precedents
PrefixCharacter
Range
Resize
Row
RowHeight
Rows
Text
UseStandardHeight
UseStandardWidth
Validation
Value
VerticalAlignment
Width
Worksheet
WrapText
Activate
AddToFavorites
ApplyTheme
BreakLink
Close
OpenLinks
PrintOut
PrintPreview
Protect
Save
SaveAs
Unprotect
Activate
Add
Calculate
Copy
Delete
Move
Paste
PasteSpecial
PivotTableWizard
PrintOut
PrintPreview
Protect
ResetAllPageBreaks
SaveAs
Select
Unprotect
Activate
AdvancedFilter
AddComment
ApplyNames
AutoFill
AutoFilter
AutoFit
BorderAround
Calculate
CheckSpelling
Clear
ClearComments
ClearContents
ClearFormats
ClearHyperlinks
Copy
CreateNames
Cut
DataSeries
Delete
FillDown
FillLeft
FillRight
FillUp
Find
FindNext
FindPrevious
Insert
InsertIndent
Justify
Merge
PasteSpecial
PrintOut
PrintPreview
RemoveDuplicates
RemoveSubtotal
Replace
Select
Sort
Subtotal
TextToColumns
UnMerge
Activate
AfterSave
BeforeClose
BeforePrint
BeforeSave
NewChart
NewSheet
Open
SheetCalculate
SheetChange
WindowActivate
WindowDeactivate
WindowResize
Activate
BeforeDoubleClick
BeforeRightClick
Calculate
Change
PivotTableUpdate
Page 2
www.TheTechMentors.com
408.375.6190