   cR.ValueType = REG_SZ
    cR.Value = sName

    ' Add the specific values:
    cR.SectionKey = cR.SectionKey &amp; "\Filter" &amp; lC
    cR.ValueKey = "Weight"
    cR.ValueType = REG_DWORD
    cR.Value = CLng(txtWeight.Text)
    cR.ValueKey = "Values"
    cR.ValueType = REG_BINARY
    ReDim bV(0 To 98) As Byte
    For i = 0 To 48
        iV = Val(txtValue(i).Text)
        If iV &lt; 0 Then
            bV(i * 2) = 1
        End If
        bV(i * 2 + 1) = Abs(iV)
    Next i
    cR.Value = bV()
    
End Su