VBA / Excel / Access / Word examples (example source code) Organized by topic

Excel /

ActiveCell 39ActiveWorkbook 17ActiveWorksheet 14AdvancedFilter 3
AutoFill 1AutoFilter 21Binding 8Cell Comments 7
Cell Copy 1Cell Format 11Cell Number Format 1Cell Protected 1
Cell Reference 7Cell Value 11Cell 12Cells 12
Chart Event 9Chart Export 2Chart Format 27Chart Lengend 2
Chart Protect 2Chart Title 5Chart 36Column 17
ComboBox 2Copy Paste 5Count 1CountA 1
Data Refresh 1Evaluate 2Excel to XML 1Excel ADO 5
Excel Buildin Function 7Excel Dialog 2Excel Recordset 2Excel Sort 1
Excel to Text File 3Excel Toolbar 2Excel Transfer 3Excel XML 12
Excel 3ExecuteExcel4Macro 2FormatConditions 21Formula 9
Hyperlinks 2Minute 1Month 3Name Create 7
Name 31Page Break 9Page Orientation 1PivotChart 1
PivotTable 11Range Add 4Range Copy Cut Paste 10Range Format 30
Range Intersect 2Range Loop 6Range Name 2Range Permission 3
Range Print 1Range Reference 20Range Union 4Range Value 6
Range 31Row Format 4Row 13Selection Format 2
Selection 13Shape 6Shapes 5SpecialCells 12
SUM 3Text to Excel 4Watch 1Workbook Encryption 2
Workbook Event 24Workbook File 12Workbook Links 3Workbook Password 3
Workbook Permission 5Workbook Protect 4Workbook SaveAs 10Workbook Share 3
Workbook Template 5Workbook 26Workbooks 32Worksheet Add 8
Worksheet Event 33Worksheet Export Import 3Worksheet Format 1Worksheet Hide 9
Worksheet Move 4Worksheet OnEntry 1Worksheet Page Header Footer 3Worksheet Print Setting 2
Worksheet Protection 9Worksheet Sort 2Worksheet 16WorksheetFunction 11
Worksheets 10

Access /

Access ADO 4Access Environment 7Access Import Export 11Access to Excel 2
Access to Word 1Access XML 4ADO Data Type 3ADO Error 1
ADODB Command 3ADODB.Connection 7ADOMD 1AllTables 4
Autonumber 2Column Constraint 3Connection String 1CurrentData 3
CurrentProject Connection 2CurrentProject 10Database Compact 1Database Create 1
Database Encrypt 1Database File 3Database Link 3Database Password 6
Database Properties 6Database Protect 3Database Replica 2Database Transfer 7
dBASE ADO 2DBEngine 3Group Account 15Index 12
Key 6Lock 6Microsoft Jet 10OLEDB 5
Oracle 1Primary Key 4Query 13QueryTable 3
Recordset Add Update Delete 12Recordset Bookmark 5Recordset Convert 1Recordset Count 2
Recordset Cursor 20Recordset Delete 2Recordset Field 4Recordset Filter 7
Recordset Find 10Recordset Open 27Recordset Save 2Recordset Seek 3
Recordset Sort 1Recordset Support 4Recordset to File 2Recordset to XML 2
Recordset Update 3Recordset 22Relationship 3Report Event 9
Report 5Reports 2SQL Parameter 6SQL Select 30
SQL Table Join 1SQL Update 5SQLServer 6Stored Procedure 7
Table Column Field 20Table Copy 1Table Create 9Table Delete 2
Table Join 2Table Output 2Table Properties 6Table Type 2
Table Update 2TableDefs 7Text ADO 1Text Transfer 2
Transaction 4UsedRange 5User Access 6User Account 12
View 5Workspaces 13

PowerPoint /

ActivePresentation 5Exchange ADO 1PowerPoint Format 8PowerPoint Slide 3
PowerPoint 3Presentations 1Slide Edit 10Slide Export Save 12
Slide Master 7Slide Print 2Slide Shape 8Slide Show 17
Slide Tempalte 3Slide Text 9Slide Transition 1

Word /

ActiveDocument 15Document Format 2Document Header Footer 11Document Print 2
Document Selection 4Document Table 33Document View 7Documents 4
Word Bookmark 3Word Document Print 2Word Document 10Word Format 2
Word Text 3Word 3

Outlook /

Email Attachment 2Email Send 1Email 9InternetExplorer 1
MailMerge 2Outlook Calendar 2Outlook Contact 6Outlook NameSpace 17
Outlook Table 2Outlook Task 4Outlook 2

Application /

ActiveInspector 4ActiveWindow 13AddIns 2Application DoEvent 1
Application Events 4Application OnKey 6Application OnTime 8Application SendKeys 2
Application Windows 7Application.DisplayAlerts 1Application.FileSearch 2Application 40
Broken Reference 1Color Constant 9Column Type 2CommandBar 53
CreateObject 1Dialogs 7DoCmd 18Environ 1
GetObject 2Immediate Window 1Menu 32Office Permmison 7
Options 13References 2SearchScopes 1SmartTag 2
StatusBar 2VBE 10Windows 6

Forms /

CheckBox 3Dir 5Find 8Focus 1
Form Control 10Form Events 16Form Recordset 1Form 13
Forms 2Image 1Label 2ListBox 11
Mouse 3Replace 3ScrollBar 1SpinButton 5
Spleash Screen 1TextBox 4

Windows API /

CPU Processor 2MDI Sound 1OSVERSIONINFO 1Printer 5
Registry 5Screen Resolution 2Shell 6Sound 2
System Memory 1SYSTEM_INFO 1Wav Sound 2Win32 API 1
Window Installation 4Windows API 5Windows Resources 18Windows User 2


DOMDocument 5XML Data 5XML Export 2XML Transformed 1
XmlMap 2

Data Type /

Array Erase 2Array Function 4Array Sort 5Array 27
Boolean 5Byte 2Collection 14Currency Format 3
Data Type 3Date Type 7Double 3Enum 3
Int 3Integer 9IS 1Long 2
Multidimensional Arrays 2Null 3Object Variable Set 12OLE Equation 1
OLE Objects 1OLEObject 1Single 3String Function 15
String 6Time 3Type Mismatch 1Type 4
TypeName 7Val 3Variant 11varType 4

Data Type Functions /

CBool 1CByte 1CCur 2CDate 1
CDbl 1CDec 1Char 3ChDir 1
ChDrive 1Chr 2CInt 2Class 9
CLng 1CSng 2CStr 1CVar 1
Data Type Convert 5Format 9FormatCurrency 1FormatDateTime 1
FormatNumber 1FormatPercent 1IsArray 2IsEmpty 3
IsNull 3IsNumeric 2LBound UBound 2

Language Basics /

ActiveForm 1ByVal ByRef 4Call 3Comparison Operators 4
Compiler Directive 4Conditional Compilation 1Const 9Debug.Assert 2
Debug.Print 2Do Until 5Do While 10Error Handler 11
Error 18Exit 3For Each 6For 11
Function Parameter 19Function Return 7Function 11GoTo 4
IF 18IIF 4InputBox 20Logical Operators 6
Mathematical Operators 2MsgBox 30Optional Arguments 1ParamArray 1
Recursive 3Resume 3Select 13Static variable 4
Sub 14Variable Declaration 6Variable Scope 10Variable Type 5
Variable 3While 1With 3

File Path /

Binary File 2CSV 6CurDir 3Drive 10
File Name 2File Read Write 2File 9FileDateTime 5
FileDialog 10FileLen 1FileSearch 9FileSystemObject 6
FileTypes 1Folder Dialog 1Folder 2FreeFile 8
GetOpenFilename 5Image Object 1Kill 2ListObject 3
Path 3Print to File 1Random Access Files 3SearchFolders 1
Sequential Access Files 3Text File 8TextStream 3WinHttpRequest 1

Date Functions /

Currency Type 2Date Format 49Date 2DateAdd 3
DateDiff 9DatePart 15DateSerial 4DateValue 3
Day 2Dynamic Array 8Hour 2MonthName 4
Now 3Number Format 15Second 1Timer Function 1
TimeSerial 3TimeValue 6Weekday 5WeekdayName 3
Year 2

Math Functions /

Abs 2Atn 2Cos 2Exp 2
Fix 4Log 2Rnd 3Sgn 4
Sin 2Sqr 2Tan 2

String Functions /

Asc 1InStr 1ISLIKE 1LCase 1
Left 2len 3Like 2Mid 2
Right 2Space 1Str 2StrComp 2
StrConv 8String Replace 1StrReverse 1Trim 1
UCase 1