Dim test(4) As String
Dim i, j, x As Integer
Dim result As Stringtest(0) = "A"
test(1) = "B"
test(2) = "C"
test(3) = "D"
test(4) = "E"For i = 0 To 4
For j = 0 To 4
x = j + i
If x > 4 Then x = x - 5
If j = 4 Then
result = result & test(x) & vbCrLf
Else
result = result & test(x)
End If
Next
NextMsgBox result
Dim i, j, x As Integer
Dim result As Stringtest(0) = "A"
test(1) = "B"
test(2) = "C"
test(3) = "D"
test(4) = "E"For i = 0 To 4
For j = 0 To 4
x = j + i
If x > 4 Then x = x - 5
If j = 4 Then
result = result & test(x) & vbCrLf
Else
result = result & test(x)
End If
Next
NextMsgBox result
'text3的multiline=true
Private Sub Command1_Click()
Dim i As Integer
Dim j As Integer, s As Integer
Dim sb As String
Dim se As String
Dim a() As String, t As String
sb = Text1.Text
se = Text2.Text
s = Asc(se) - Asc(sb) + 1
ReDim a(1 To s)
For i = 1 To s
If i = 1 Then
a(i) = sb
Debug.Print a(i)
Else
a(i) = Chr(Asc(a(i - 1)) + 1)
Debug.Print a(i)
End If
Next
For j = 1 To s
For i = 1 To s
Text3.Text = Text3.Text & a(i)
Next
t = a(1)
For i = 1 To s - 1
a(i) = a(i + 1)
Next
a(s) = t
Text3.Text = Text3.Text & vbCrLf
Next
End Sub
test(0) = "A"
test(1) = "B"
test(2) = "C"
test(3) = "D"
test(4) = "E"
Dim i, j, x As Integer
Dim result As String
your string="A,B,C,D,E"'里面的字符可以换,随便你定义
text()=split("your string",",") For i = 0 To ubound(text)
For j = 0 To ubound(text)
x = j + i
If x > ubound(text) Then x = x - ubound(text)-1
If j = ubound(text) Then
result = result & test(x) & vbCrLf
Else
result = result & test(x)
End If
Next
NextMsgBox result