我想将一些数据,用循环语句将距地循环组合,例如,我有一组数据AB AC AS
AD AF等,另外一组数据系1,2,3,4,5等,我想组合他们,得出应该有25条数据吧
,那怎样写呢?请教一下

解决方案 »

  1.   

    dim a(6) as string
    dim b(6,6) as string
    a(1)="AB"
    a(2)="AC" 
    a(3)="AD"
    a(4)="AS" 
    a(5)="AE"
    for i=1 to 5
       for j=1 to 5
          b(i,j)=a(i) & j
       next
    next差不多就这意思了,b就是组合后的东西了
      

  2.   

    Private Sub Form_Load()
    Me.AutoRedraw = True
    Dim str1() As String
    str1 = Split("AB AC AS AD AF", " ")
    Dim str2() As String
    str2 = Split("1,2,3,4,5", ",")
    Dim i As Integer, j As Integer
    For i = LBound(str1) To UBound(str1)
        For j = LBound(str2) To UBound(str2)
            Print str1(i) & str2(j)
        Next
    Next
    End Sub