Sub bb()
On Error GoTo 10:
n = 1237
s = Hex(n)
l = "0000000100100011010001010110011110001001101010111100110111101111"
e = ""
e = e & Mid(l,CLng("&H" & Mid(s,1,1)) * 4 + 1,4)
e = e & Mid(l,CLng("&H" & Mid(s,2,1)) * 4 + 1,4)
e = e & Mid(l,CLng("&H" & Mid(s,3,1)) * 4 + 1,4)
e = e & Mid(l,CLng("&H" & Mid(s,4,1)) * 4 + 1,4)
e = e & Mid(l,CLng("&H" & Mid(s,5,1)) * 4 + 1,4)
e = e & Mid(l,CLng("&H" & Mid(s,6,1)) * 4 + 1,4)
e = e & Mid(l,CLng("&H" & Mid(s,7,1)) * 4 + 1,4)
10:
MsgBox "二进制为" & e
End Sub
