binary to decimal vba code
Sub bd()
Funcion Bin2Dec(binVal As String) As Long
Dim binary As Double
Dim iLen As Integer
binVal = Range("c4").Value
iLen = Len(binVal) - 1
For binary = 0 To iLen
bin2dec = bin2dec + _
Mid(binVal, iLen - x + 1, 1) * 2 ^ x
Next
End Function
End Sub