The VBA Code Explorer is a reference library for the Excel object model. Pick an object, then browse its methods and properties, each with syntax and a working example.
VBA Code Explorer showing Application, Workbook, Worksheet and Range objects with methods, properties and UserForm controls.

Know the task but not the object?

This page is organised by object — useful when you know you are working with a Range and need the exact syntax. If instead you know what you want to do — merge cells, delete rows, send an email — start with 100+ Excel VBA macro examples, which is organised by task.

Browse by Excel object

ApplicationExcel itself — calculation mode, alerts, screen updating, status bar and the settings that make macros fast and quiet.

6 methods · 13 properties

Most used: ScreenUpdating, Calculation, EnableEvents, DisplayAlerts

WorkbookOpening, saving, closing, protecting and emailing whole files, and controlling which workbook your code is actually talking to.

14 methods

Most used: SaveAs, Close, Save, Protect, SendMail

WorksheetAdding, copying, moving, deleting and protecting sheets, and looping through every sheet in a workbook.

8 methods

Most used: Copy, Delete, Move, Protect, Activate

RangeCells, rows, columns and selections. The object you will use in almost every macro you ever write.

18 methods

Most used: Copy, Find, Delete, Insert, PasteSpecial, ClearContents

ActiveX ControlsButtons, checkboxes, combo boxes and text boxes placed directly on a worksheet, and the properties that control how they look and behave.

8 controls · CheckBox, ListBox and more

CheckBox, ComboBox, CommandButton, Image, Label, ListBox, OptionButton, TextBox

UserFormThe same family of controls, but on a proper dialog rather than the sheet. This is where VBA still beats every alternative.

8 controls

CheckBox, ComboBox, CommandButton, Image, Label, ListBox, OptionButton, TextBox

Quick reference: the members you will reach for most

If you are here often, these are the twelve worth bookmarking.

Member Object What it does
ScreenUpdating Application Switch off while a macro runs. The single biggest speed win in VBA.
Calculation Application Set to manual so Excel is not recalculating on every write.
EnableEvents Application Stop your own code triggering Worksheet_Change and looping forever.
DisplayAlerts Application Suppress the “are you sure” prompts when deleting or overwriting.
Find Range Locate a value without looping. Far faster than a For Each.
Copy Range Copy a range, with or without the clipboard.
PasteSpecial Range Paste values, formats or transposed data.
ClearContents Range Wipe the data but keep the formatting.
Delete Range Remove cells, rows or columns and shift the rest.
SaveAs Workbook Save under a new name, path or file format.
Close Workbook Close with or without saving, without a prompt.
Copy Worksheet Duplicate a sheet inside the workbook or into a new one.

Not looking for an object?

These three are not part of the object reference, but they are where most readers end up next.

15 Macros for BeginnersFifteen short, complete macros with a downloadable file. Start here if the object model does not mean anything to you yet.

100+ Macro ExamplesThe same material organised by task rather than object. Cells, rows, sheets, files, charts, pivot tables, Outlook.

VBA ProjectsComplete working applications with source code — a data entry form, a calculator, a folder lister, a multi-sheet consolidator.

How to use a reference page

  1. Start from the object, not the taskAsk what you are acting on. Deleting rows means you are acting on a Range. Renaming a tab means a Worksheet. Turning off prompts means Application.

  2. Method or property?A method does something — Copy, Delete, Find. A property is something you read or set — Value, ScreenUpdating, Caption. If you would use a verb, look under Methods. If you would use a noun, look under Properties. Full explanation of objects, properties and methods.

  3. Copy the syntax, then adapt itEvery page gives the syntax and a runnable example. Change the sheet and range references to your own before running it against real data.

  4. Check it in the Object BrowserPress F2 in the VBA editor to see every member of every object your installation supports, including any this reference does not cover yet.

Missing something?

This library grows from reader questions. If a method or property you need is not here, leave a comment and it usually gets written up within a few days — that is how most of these pages came to exist.

Related VBA references