Skip to content

VBA270 — Type-declaration character does not match declared type

Severity: 🔴 error Category: declaration Phase: 2.14

Description

A legacy type-declaration suffix ($ String, % Integer, @ Currency) on a variable name must agree with its explicit As type.

Failing example

Dim count% As Long

Compliant example

Dim count As Long   ' or: Dim count%

How to fix

Drop the suffix, or make the As type match it.


Source: src/rules.py — entry VBA270.