Convert Binary to a String

Convert String to Binary

Please use the code below, please replace the section following sInputString to the actual binary you want to convert to text

Option Explicit

Sub Main()

Dim sInputString As String

sInputString = "01010100 01110010 01110101 01101101 01110000 00100000 01101001 01110011 00100000 01100001 01101110 00100000 01100001 01110011 01110011 00101110"
Debug.Print TranslateToString(sInputString)

End Sub

Function TranslateToString(sInput As String) As String
Dim sBinObjects() As String, iWordCount As Integer

    sBinObjects = Split(sInput, " ")
    For iWordCount = 0 To UBound(sBinObjects)
        TranslateToString = TranslateToString & ConvertBinaryToChar(sBinObjects(iWordCount))
    Next iWordCount

End Function

Function ConvertBinaryToChar(sBinNumber) As String
Dim iIndex As Integer, dValue As Double, iDigit As Integer


    For iIndex = 0 To 7
        iDigit = Mid(sBinNumber, 8 - iIndex, 1)
        dValue = dValue + 2 ^ (iIndex) * iDigit
    Next iIndex
    ConvertBinaryToChar = Chr(dValue)
End Function

 

Text 2

More text goes here.