Skip to content

VBA001 — Undefined identifier

Severity: 🔴 error Category: name_resolution Phase: 0

Description

A symbol is referenced that is not declared in any visible scope.

Failing example

Sub S()
    typo = 1
End Sub

Compliant example

Sub S()
    Dim count As Long
    count = 1
End Sub

How to fix

Declare the variable with Dim or fix the spelling.


Source: src/rules.py — entry VBA001.