Excel VBA Examples

From this page of Excel VBA examples you can navigate to all the pages of VBA Excel examples on this site. This site has two main pages with links to VBA code. One is our Free VBA Tutorials page and the other is the VBA Code Samples page. This page organizes all the Excel VBA Examples in one place.

Excel VBA Examples - Part 1

How to cause code to be run when Excel opens
In this example we'll see how to cause your code to be run when Excel opens.

Using the VBA Label to Create Flash Cards.
This is a tutorial that uses the VBA label to create flash cards and uses Excel.

Finding the Last Populated Cell, Row, or Column in a Worksheet
This example shows how to find the last populated Cell, Row, or Column in a Worksheet.

How to move to a specific cell
Learn how to move to a specific cell, such as the maximun value in a Worksheet.
  
How to delete a column
Shows code to delete a complete column.

The Excel Worksheets add method
Learn how to add a Worksheet to a Workbook.

Code to track expenses and calculate totals
In this example, we want to track expenses and calculate the day totals as well as each category total. We will see how these calculations are achieved manually in ten steps and create a button to perform these in one click.
 
How to Use VBA Shell to open Excel from Word or Outlook
Using the VBA Shell command you can open any application from Word, Excel, Outlook, and Powerpoint.

Access other code libraries installed on your computer
Such as opening and operating in a Word document from Excel (Microsoft Word 11.0 Object Library), access the file system (Microsoft Scripting Runtime) delete, create, etc. access a database (Microsoft ActiveX Data Objects 2.8 Library), or any other library that is installed on your computer.

VBA Load combobox
Load a combobox from an Excel Spreadsheet and fill a second combobox according to the selection in the first combobox.

How to Debug your code
This is a tutorial that explains how to debug your code. Debugging is running your code step by step from where you decide to see why and where it isn't working acording to how you thought.

Create a stopwatch on a form in Excel
This is a tutorial that uses the VBA Timer to create a stopwatch on a userform.

Import a comma-separated text file into Excel
Code to import a comma-separated text file into Excel.

Import a tab-delimited text file into Excel
Code to import a tab-delimited text file into Excel.

VBA Excel Range
Three ways to refer to a Range in Excel. Directly, the Cells method, and the Offset method.

How to change the cursor
How to change the cursor in Excel or in a userform.

Excel VBA Examples - Part 2

How to get the letter of a column
Two way to get the letter name of a column.

Exporting your VBA code
using this code you can export the VBA in Excel, Word, etc. by adding a reference to the Microsoft Visual Basic for Applications Extensibility 5.3"

Create a Progress bar in Excel
Code to create a Progress Bar.

Using If/Then/Else statements in VBA
If/Then/Else statements are one way you can choose which path the code will run depending on a condition.

Dealing with Errors that occur while your code is running
Learn to trap Errors that occur so that the user won't see or get them.

Excel VBA tutorials start page
Page to look at if your just starting from the very beginning.

A tutorial on how to create a multiplication table

Using an API
Using the Sleep Api.

Create a Userform that opens when Excel opens a workbook
How to create a form that opens when Excel opens.

This site is powered by Site Build It!. If you enjoy it, please check out the
Site Build It homepage
 to learn more and on how to build a success-guaranteed site with no technical skills.

Custom Search






Return from an Excel VBA Examples to our Home Page