Public Function ToBinary(ByVal Number As Long) As String
ToBinary = Oct$(Number)
ToBinary = Replace(ToBinary, "0", "000")
ToBinary = Replace(ToBinary, "1", "001")
ToBinary = Replace(ToBinary, "2", "010")
ToBinary = Replace(ToBinary, "3", "011")
ToBinary = Replace(ToBinary, "4", "100")
ToBinary = Replace(ToBinary, "5", "101")
ToBinary = Replace(ToBinary, "6", "110")
ToBinary = Replace(ToBinary, "7", "111")
End Function
|