Sajjad
0
Q:

vba make integer 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
8
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)
4

New to Communities?

Join the community