Tag Archives: VBA For Excel

Cross Products with Excel and VBA

Microsoft Excel does not have the built-in worksheet functions to calculate the cross product of two vectors. Therefore, some techniques are required to do the calculation — either by setting up your own formula in a worksheet or by creating a custom VBA function. The

How to Use NumberFormat in VBA

Description FormatNumber is a property of the Range object of Excel. The Range object can be considered as a cell or a group of cells — be that a single cell, a column in an Excel table, or the UsedRange of an Excel sheet. The

How Do You Fix an Automation Error in VBA?

One of the more frustrating errors to occur in VBA is the Automation Error.  It can often pop up for no apparent reason despite your code looking perfect. Reasons for This Error There are a variety of reasons that this can occur. Microsoft Office is

How to Use the Mod Operator in VBA

Introduction Mod stands for Modulo. It is a mathematical operator that returns the remainder, or modulus, of a number after performing division. The Mod operator is not only helpful when you want to know the remainder in division, it is also powerful when you want

No Thumbnail

VBA Excel Working With Protected Sheets

Jump To: Unprotecting and Protecting the Worksheets Unprotecting and Protecting Workbooks Unprotecting and Protecting the Worksheets: As a VBA programmer you will often have protected sheets where you would like your program to be able to modify but still remain protected from the users. There

No Thumbnail

Searching Data In Excel Sheets

One of the main tasks an Excel VBA programmer encounters is  searching excel sheets for a specific value. While there are many different methods for doing a search, in this article I will only cover the basic method of using a For Next loop. In

No Thumbnail

Excel VBA Drop Down Lists Using Data Validation

In this article I will explain how you can create drop down lists using data validation.   Jump To: Creating Data Validation (Manually) Creating Data Validation (Using VBA) Selection Change Modifying, Adding, Inserting and Removing Items (Usin VBA)   You can download the file and code related

No Thumbnail

Referencing Ranges In Excel Using VBA

In this article I will explain how to work with the Range and Cell objects. While the terms range and cells may be used interchangeably, they are two different objects, and have different functions and properties. There are two main notations for referencing ranges: Range(“A1:B1”) notation Range( Cells(1,