Try to use this code i hope it will work for you.
HTML Code:
Function IntToBin(ByVal IntegerNumber As Long)
IntNum = IntegerNumber
Do
TempValue = IntNum Mod 2
BinValue = CStr(TempValue) + BinValue
IntNum = IntNum \ 2
Loop Until IntNum = 0
IntToBin = BinValue
End Function
Function BinToInt(ByVal BinaryNumber As String)
Length = Len(BinaryNumber)
For x = 1 To Length
TempValue = TempValue + Val(Mid(BinaryNumber, Length - x + 1, 1)) * 2 ^ (x - 1)
Next
BinToInt = TempValue
End Function
Private Sub Command1_Click()
Text2.Text = IntToBin(Val(Text1.Text))
End Sub
Private Sub Command2_Click()
Text4.Text = BinToInt(Text3.Text)
End Sub
Bookmarks