VBA IsArray Function

Written by

Editorial Team

Reviewed by

Steve Rynearson

Last updated on July 19, 2021

IsArray Description

Used to check if a supplied variable is an array or not.

Simple IsArray Examples

Dim a() As Integer
Debug.Print IsArray(a)

Result: True

Dim b As Integer
Debug.Print IsArray(b)

Result: False

IsArray Syntax

In the VBA Editor, you can type  “IsArray(” to see the syntax for the IsArray Function:

The IsArray function contains an argument:

VarName: A variable that will be evaluated.

Examples of Excel VBA IsArray Function

MsgBox IsArray("(1, 2, 3)")

Result: False

MsgBox IsArray(Array(1, 2, 3))

Result: True

Sub IsArray_Example1()
    Dim s As Variant
    s = Split("A, B, C")
    MsgBox IsArray(s)
End Sub

Result: True

VBA Coding Made Easy

Stop searching for VBA code online. Learn more about AutoMacro - A VBA Code Builder that allows beginners to code procedures from scratch with minimal coding knowledge and with many time-saving features for all users! vba save as

Learn More!

VBA Code Examples Add-in

Easily access all of the code examples found on our site.

Simply navigate to the menu, click, and the code will be inserted directly into your module. .xlam add-in.

(No installation required!)

Free Download

Return to VBA Code Examples