Option Explicit
Private Function Calculate(ByVal Binary As String) As Long
Dim i As Long, counter As Long, decima As Long _
, quotient As Long, remainder As Long
i = Len(Binary): decima = 0
For counter = 1 To i
decima = (2 ^ (i - counter)) * Val(Mid(Binary, counter, 1)) + decima
Next
quotient = decima / 3
remainder = decima Mod 3
Print "Quotient is "; quotient; Chr(10); "Remainder is "; remainder
End Function
Private Sub Form_click()
Dim inputer As String
inputer = InputBox("Input Binary Number", "Input")
Calculate (inputer)
End Sub