Skip to content

VBA102 — ReDim target not a variable

Severity: 🔴 error Category: declaration Phase: 1.4

Description

ReDim was applied to something other than an array variable (procedure, class, …).

Failing example

ReDim Foo(1 To 10)  ' Foo is a Sub

Compliant example

Dim arr() As Long
ReDim arr(1 To 10)

How to fix

Check the name resolves to a dynamic-array variable.


Source: src/rules.py — entry VBA102.