Is there any way through which I can split a single string into substrings with 20 characters each.
The first string should contain first 20 characters.
The seconds string should contain the next set of 20 characters and so on.
Is it possible to do what I'm thinking?

9 Years
Discussion Span
Last Post by rstkw

can you try this one
you can set the multiline property of text2 to True

Dim strx As String
Dim cntr As Integer
Dim xstart As Integer
Dim sellen As Integer
Dim num As Integer
Dim storex(0 To 20) As Variant
Dim xlen As Integer
Dim xnewstr As String

Private Sub Command1_Click()

sellen = Text3.Text
strx = Text1.Text
xlen = Len(Text1.Text)
num = xlen / sellen
xnewstr = Left(strx, sellen)
xstart = 1
cntr = 0

Do Until cntr = num
    xnewstr = Mid(strx, xstart, sellen)
    storex(cntr) = xnewstr
    xstart = xstart + sellen
    cntr = cntr + 1
    Text2.Text = Text2.Text & vbCrLf & xnewstr

End Sub
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.