Function Dec2Bin(ByVal x As Integer) As String
Dim t As Integer, r As String
r = "": t = x
While t >= 2
r = Trim(Str(t Mod 2)) + r
t = t \ 2
Wend
Dec2Bin = Trim(Str(t)) + r
End Function
Sub test()
MsgBox Dec2Bin(35)
End Sub
Function Dec2Bin(ByVal x As Integer) As String
Dim t As Integer, r As String
r = "": t = x
While t >= 2
r = Trim(Str(t Mod 2)) + r
t = t \ 2
Wend
Dec2Bin = Trim(Str(t)) + r
End Function
Sub test()
MsgBox Dec2Bin(35)
End Sub