xl vba is bit set in byte code example
Example 1: vba make word from bytes
Public Function MakeInteger%(LoByte As Byte, HiByte As Byte)
If HiByte And &H80 Then
MakeInteger = ((HiByte * &H100&) Or LoByte) Or &HFFFF0000
Else
MakeInteger = (HiByte * &H100) Or LoByte
End If
End Function
Example 2: excel vba first byte from INTEGER
LoByte = n And &HFF '<-- if n is a 2-byte Integer (left byte)
HiByte = (n And &HFF00&) \ &H100 '<-- if n is a 2-byte Integer (right byte)