Table of Contents

VBC09365 — Range has no values

Severity: Error  ·  Family: VBC (static semantics / abstract syntax tree)  ·  Source metadata: VBCompileErrorInfo

An array is declared with an upper bound less than its lower bound.

A dimension of an array has the elements from its lower bound to its upper bound: an upper bound less than the lower one leaves it none. With no lower bound written, Option Base says what it is, and an upper bound less than zero is less than either.

MS-VBA reports the same error, with the same message (recorded in Excel).

This code is raised where the bounds an array is declared with are checked, for bounds written as numbers.

How it is raised

Situation Example Resolution
An upper bound less than the lower one. Dim a(5 To 1) As Long Write the bounds in order: Dim a(1 To 5) As Long.
A negative upper bound and no lower bound. Dim a(-1) As Long Write the lower bound, or an upper bound of zero or more.

See also


⏮️ VBC09364 Expected Sub, Function, or Property | ⏭️ VBC09366 A module is not a valid type


ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca