Answers for "vba long integer variable to bits excel"

VBA
11

excel vba long integer to bits

Function LongToBits$(ByVal n&)
    Dim i&
    LongToBits = "00000000000000000000000000000000"
    If n And &H80000000 Then
        Mid$(LongToBits, 1, 1) = "1"
        n = n And Not &H80000000
    End If
    For i = 32 To 2 Step -1
        If n And 1 Then Mid$(LongToBits, i, 1) = "1"
        n = n \ 2
    Next
End Function

'------------------------------------------------------------------------------

MsgBox LongToBits(0)			'<--displays: 00000000000000000000000000000000
MsgBox LongToBits(293781237)	'<--displays: 00010001100000101011111011110101
MsgBox LongToBits(-1)			'<--displays: 11111111111111111111111111111111
Posted by: Guest on May-23-2020
3

excel vba make long from two shorts

Public Function MakeLong&(ByVal LoWord%, ByVal HiWord%)
    MakeLong = (HiWord * &H10000) Or (LoWord And &HFFFF&)
End Function
Posted by: Guest on May-23-2020

Code answers related to "vba long integer variable to bits excel"

Code answers related to "VBA"

Browse Popular Code Answers by Language