questa funzione converte un valore (Value) in binario restituendolo in una stringa lunga N_bit
codice:
Private Function BoolStr(ByVal Value As Long, ByVal N_bit As Integer) As String
    If N_bit = 1 Then
        If Value = 1 Then
            BoolStr = "1"
        Else
            BoolStr = "0"
        End If
        Exit Function
    End If
    If Value >= 2 ^ (N_bit - 1) Then
        BoolStr = "1" + BoolStr(Value - 2 ^ (N_bit - 1), N_bit - 1)
    Else
        BoolStr = "0" + BoolStr(Value, N_bit - 1)
    End If
End Function
puoi farti un array lungo 2^n e riempirlo con un ciclo