How do I... (Excel VBA reference)
This topic links to programming tasks (how-to and walkthrough topics) for common Excel scenarios.
"How Do I ..." is your gateway to key task-based topics about programming and application development using Excel. The essential categories for what you can do with Excel are listed in this topic. The links provide pointers to important, procedure-based Help topics.
Workbooks and Worksheets
How to: Add a Table of Contents to a Workbook
- Describes how to add a table of contents worksheet to a workbook.
How to: Create Address Labels from a Spreadsheet
- Describes how to take a list of addresses arranged as one address per row, and arrange them to fit on printable address labels.
Create a Scheduling Calendar Workbook
- Describes how to use information in one workbook to create a scheduling calendar workbook that contains one month per worksheet and can optionally include holidays and weekends.
-
- Describes how to create a workbook using Excel.
-
- Describes how to create or replace a worksheet in an existing workbook.
Name a Worksheet By Using a Cell Value
- Describes how to name a worksheet based on a value in a cell.
How to: Refer to More Than One Sheet
- Describes how to refer to more than one worksheet in Excel.
How to: Refer to Sheets by Index Number
- Describes how to refer to worksheets by index number.
How to: Refer to Sheets by Name
- Describes how to refer to worksheets by name.
Sort Worksheets Alphanumerically by Name
- Describes how to sort worksheets in a workbook alphanumerically by name.
Cells and Ranges
Create an HTML File with a Table of Contents based on Cell Data
- Describes how to take data from a worksheet and create a table of contents in an HTML file.
Delete Duplicate Entries in a Range
- Describes how to delete duplicate entries in a range.
Fill a Value Down into Blank Cells in a Column
- Describes how to fill a value down into blank cells.
-
- Describes how to find all the cells that contain a certain value and hide or unhide the columns that contain that value.
Highlight the Active Cell, Row, or Column
- Describes how to highlight the active cell, or column with a color.
-
- Describes how to make a cell blink by changing the color of the cell.
Prevent Duplicate Entries in a Range
- Describes how to prevent duplicate entries of a value in a given range.
How to: Reference Cells and Ranges
- Describes how to reference cells and ranges in order to do enter formulas or change formats.
How to: Refer to All the Cells on the Worksheet
- Describes how to refer to all cells on a worksheet.
How to: Refer to Cells and Ranges by Using A1 Notation
- Describes how to refer to cells and ranges by using A1 notation.
How to: Refer to Cells by Using a Range Object
- Describes how to refer to cells by using a Range object.
How to: Refer to Cells by Using Index Numbers
- Describes how to refer to cells by using index numbers.
How to: Refer to Cells by Using Shortcut Notation
- Describes how to refer to cells by using shortcut notation.
How to: Refer to Cells Relative to Other Cells
- Describes how to refer to cells relative to other cells.
How to: Refer to Multiple Ranges
- Describes how to refer to multiple ranges.
-
- Describes how to refer to named ranges.
How to: Refer to Rows and Columns
- Describes how to refer to rows and columns in Excel.
-
- Describes how to select the used range and the data range on a worksheet.
Controls, Dialog Boxes, and Forms
Add a Unique List of Values to a Combo Box
- Describes how to take a list from a spreadsheet and use it to populate a combo box control using only the unique values.
How to: Add Controls to a Document
- Describes how to add controls to a document.
How to: Add Controls to a User Form
- Describes how to add controls to a user form.
Automatically Dismiss a Message Box
- Describes how to automatically dismiss a message box.
How to: Create a Custom Dialog Box
- Describes how to create a custom dialog box.
Create a Custom Menu That Calls a Macro
- Describes how to create a custom menu with four menu options, each of which calls a macro.
-
- Describes how to create a user form.
Sparklines
-
- Describes how to animate a sparkline.
Change the Color of the Horizontal Axis of a Sparkline
- Describes how to change the color of the horizontal axis of a sparkline.
Find All the Sparklines on a Sheet
- Describes how to find all the sparklines on a worksheet.
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for