VBA Course: Using Functions

VBA Functions

There are many VBA functions that you can use in your developments.

We have used some of them throughout the course examples, such as the IsNumeric, Year, Split, Join, Array, Date, Chr functions, etc.

You can find the list of all the main VBA functions (with an example of usage for each function) in the VBA Functions section.


Excel Functions

It is also possible to use Excel functions in VBA code.

After entering WorksheetFunction followed by a ., the list of functions appears:

1 vba functions

The function chosen for this example is COUNTBLANK.

The following example displays the number of blank cells in the range A1:D8 in a message box:

Sub example()

    MsgBox WorksheetFunction.CountBlank(Range("A1:D8"))

End Sub