Category Archives: VBA

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

VBA vs Python: Key Differences Plus a Dose of History

Introduction When beginning your coding career, you will certainly ask yourself questions like, “What exactly is a programming language?”, “Which programming language should I learn”, “What is the difference between language A and language B”, etc. The answer to these questions and many others can

No Thumbnail

Visual Basic vs. Visual Basic for Applications

Over the years, I have been asked this question many times: What is the difference between VB and VBA? I tried to answer in many ways, but, ultimately, I found this answer the easiest one for most people to understand quickly: With VB, you make

Using VBA Sum and VBA Sum Range

The Sum function in Excel is one of the most widely used functions, and in fact, probably one of the first functions that an Excel user learns when they are learning to use Excel!  Simply stated, the Sum function adds up a range of cells for

VBA vs. VB.Net — What’s the Difference?

VBA is the programming language behind Microsoft Office.  It is derived from a programming language called Basic. VB (Visual Basic) is also derived from Basic. For nearly all programming purposes, they are the same language. VB can either refer to straight Visual Basic (the last version

The Guide to Removing Characters from Strings in VBA

String manipulation is a crucial skill in VBA programming. The skill level of a VBA developer is often determined by how well he/she can manipulate string data. Excel is very strong in mathematics operations and comes with loads of built-in calculation functions. But text manipulation

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