Someone knows what should i do? it says expected array
dim szamok As String
szamok = Range("f2")
Dim hossz As Integer
ReDim karakterek(1 To Len(szamok)) As Characters
For i = 1 To Len(szamok)
karakterek(i) = szamok(i)
Next i
I believe this is what you need:
Dim szamok As String
Dim hossz As Long
Dim karakterek As Variant
szamok = Range("F2").Value
ReDim karakterek(1 To Len(szamok))
For i = 1 To Len(szamok)
karakterek(i) = Mid(szamok, i, 1)
Next i
Changes to original code:
Dim karakterek as Variant before Redim
Get characters from szamok using Mid
As described here, you can simply use
Dim bytes() as Byte
bytes = StrConv("Xmas", vbFromUnicode)
Redimif you haven't dimmed in the first place; (2) I think your declaration should be of typeStringrather thanCharactersif it contains text.szamok(i)is wrong asszamokis a string not an array. So if F2 contains "Fred" do you want an array of 4 elements, "F", "R","E" and "D"?