Category Archives: VBA

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

How to Use IF OR Statements in VBA

In VBA, IF OR is the combined utilization of the IF statement and the OR keyword. Particularly, the OR keyword is used to construct the logic of the condition statement. The syntax for the combined IF OR statement is as follows: IF [condition statement 1]

Using the VLookup Function in VBA

The VLookup function is an Excel function.  It can be used directly on your worksheet without having to use any VBA code.  However, there may be instances in VBA where you wish to also use VLookup functionality. You would then need to call the VLookup

The VBA OnTime Method : How to Set Up Scheduled Tasks

With Application.OnTime, you can schedule a macro (a procedure) to run at a specific time in the future. This is especially useful for setting up scheduled tasks which you want your computer to kick-off while you’re away from your computer, such as night jobs. OnTime