excelvba make a short integer from two bytes code example
Example 1: excel vba last 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)
Example 2: excel vba high word from Long Integer
'If n is a 4-byte Long Integer, the Low (Left) Word is:
If n And &H8000& Then
LoWord = n Or &HFFFF0000
Else
LoWord = n And &HFFFF&
End If
'If n is a 4-byte Long Integer, the High (Right) Word is:
HiWord = (n And &HFFFF0000) \ &H10000