All posts by Joseph Maabo

option explicit is automatically filled in

Everything About Option Explicit in VBA

As a developer, it is a good practice to declare your variables in a script/code so that you immediately get the source of an error when running it. Option Explicit is used in VBA precisely to make the defining of variables mandatory while writing code.

Vbcrlf: The Visual Basic Carriage Return Line Feed

To facilitate the reading of a messages by users or readers – especially long messages – it is necessary to format it conveniently through new lines, alignment, new paragraphs, etc. For a specialized word processing software like MS Word, this is easy. For example, to

Subscript Out of Range: How Do You Fix It?

When running a VBA procedure, you might receive this error message “Run-time error ‘9’, Subscript out of range”. In this article, we will talk about the possible reasons for the occurrence of this error and the ways to fix it.  According to our recent review,

Ubound example

The VBA Ubound function

Description The VBA UBound (Upper Bound) function returns the upper limit of an array as opposed to the LBound (Lower Bound) that returns the lower limit of an array. Both functions (UBound and LBound) can be combined to determine the size of an array. Syntax

How to use the OnKey method in Excel VBA

As a VBA developer you sometimes need to use a key or a combination of keys to run a procedure without using the command button on a UserForm. This is possible with the VBA onkey method. Syntax The syntax for the OnKey method is: Application.OnKey