Skip to content

VBA104 — Erase target undefined

Severity: 🔴 error Category: declaration Phase: 1.4

Description

Erase is applied to a name that has not been declared.

Failing example

Erase notDeclared

Compliant example

Dim arr() As Long
ReDim arr(1 To 5)
Erase arr

How to fix

Declare the array variable first.


Source: src/rules.py — entry VBA104.