Function Windows API Class

HIWORD

"High Word" Return the high-order word (2 bytes) of a Long (Integer) value. Return the Integer value whose in-memory representation is the same as the left-most, most-significant-word of Long value vValue.

Signature (Visual Basic / VBA)

Public Function HIWORD( _
    ByVal vValue As Long _
    ) As Integer

Code Example

    HIWORD(131073) = 2
    HIWORD(65538) = 1
    HIWORD(2147418112) = 32767
    HIWORD(-2147418112) = -32767

Notes & Version History

Note Use the CoerceTwoIntegersToLong function to reconstruct a Long from two Integer values.
Note Similar to but faster than using the MakeLong and CoerceToInteger functions.