CByte

This function converts an expression to a Variant of subtype Byte.

Syntax

CByte(expression)

Parameters

expression
Any valid expression.

Return Values

Returns a Byte expression.

Remarks

Use CByte to force byte arithmetic in cases where using expression directly would result in a type mismatch or other error.

If expression lies outside the acceptable range for the Byte subtype, an overflow error occurs.