Category Archives: Excel

Using the UCase Function in Excel VBA

There may be a time in Excel that you need data that you are fetching from an Excel spreadsheet or importing from external data to be amended to upper case.  This can, of course, be done manually, but if it is a large amount of

How to Pause a Macro: The VBA Wait Method

The VBA Wait method is used to pause the execution of a macro, suspending all Microsoft Excel activities until a certain time is elapsed. Syntax Application.Wait(time) The function requires one mandatory parameter input of time, which is the time you want the macro to resume,

The Ultimate Guide to Looping Through Ranges in VBA

The art of Excel VBA programming is in the manipulation of properties of objects of Excel. The more skillfully you can play with these objects and properties, the more powerful the macros you can build. The number one object in Excel you have to process

VBA Error 400: What Are the Causes and How to Fix It?

Introduction It is often said that debugging is part of programming, and through error messages, the programmer can easily identify where there are problems in his/her code. But as you can see from the above screenshot the VBA Error 400 is one of those annoying

IsNumeric in VBA: 8 Ways to Use the Function

In VBA, to test whether an expression is a number, the IsNumeric function can be used. Description The IsNumeric function evaluates whether the input expression is a number and returns a Boolean value (TRUE or FALSE). It returns True if the entire expression is a number; otherwise, it returns False. Syntax IsNumeric(expression) The

Rounding with VBA and Excel: Functions and Gotchas

VBA is often used for calculations – when you create these calculations, you can end up with a number that has multitude of decimal places.  The Round function in VBA lets you round the number to a set amount of decimal points, or to remove

A Complete Guide to Loops in VBA

When you write good VBA code, you try not to repeat yourself too often – in other words, you try not to write the same code for repetitive tasks more than once.  Looping structures are an invaluable part of VBA and you will use them

How to Use ByVal in VBA

Using the ByVal argument in VBA is a way to pass values to a function in VBA while retaining the original value of the variable. For example, you may have a list of names and dates of birth in your Excel sheet, and you wish