Byte

The byte data type can contain positive whole numbers between 0 and 255.
This can be used to contain binary data.
This data type uses 1 byte
The default value is 0.

Dim myByte As Byte 

Run-Time Errors

Assigning a negative number to a byte variable will generate a run-time error.
Assigning a number greater than 255 will generate a run-time error.


Conversion Function

The CBYTE function returns an expression converted to a Byte data type.


Byte Arrays

Dim myArray() As Byte 
Dim sText As String
sText = "Better Solutions"
myArray = sText
Debug.Print myArray(0) '= 66 = ASC("B")

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext