Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

Numbers

  • Last UpdatedJul 18, 2023
  • 1 minute read

VBA supports three representations of numbers: decimal, octal, and hexadecimal.

To indicate the use of octal (base 8) or hexadecimal (base 16) numbers, prefix the number with &O or &H respectively. If no prefix is included with a number, it is treated as decimal (base 10). For example:

Dim vntVar as Variant

vntVar = 12345 ' assign decimal value

vntVar = &o12345 ' assign octal value

vntVar = &h12345 ' assign hexadecimal value

Most numbers used in VBA formulas are decimal numbers. Decimal numbers consist of integral values (known as integers) positioned to the left of the decimal point, and fractional values (known as fractions) positioned to the right of the decimal point. If the decimal point is omitted, the number is treated as an integer (whole number with no fraction).

When using numbers in VBA, consideration needs to be given to the data type of the variables that hold and store the numbers, as well as to the behaviour of VBA when dealing with numbers. For details, see Numeric Data Types, Floating Point Calculation Rules, and Rounding Numbers.

See Also

Variant Declaration

Strings

Variables

Constants

VBA Data Types

VBA Function Reference

TitleResults for “How to create a CRG?”Also Available in