簡易2進数表記
Public Function Dec2Bin(DecValue As Long, Optional Keta As Long = 0) As String Dim b$, i& b = Oct$(DecValue) For i = 0 To 7 b = Replace(b, i, Choose(i + 1, "000", "001", "010", "011", "100", "101", "110", "111")) Next i If Keta > 1 Then b = Format$(b, String$(Keta, "0")) Else b = Format$(b, "#0") End If Dec2Bin = b End Function