Variant

The Variant type is a dynamic container that can hold any other type (string, number, object, etc.). Ideal for situations where the type may vary at runtime.

  • Declaration
Dim v As Variant
v = "Hello"
v = 123
v = Array(1, 2, 3)