Sub test()Dim a(9) As Integer, i As Integer Dim total as string total="" For i = 1 To 10 a(i - 1) = Range("A" & i) total=total & " " & a(i-1) & " " Next msgbox total End Sub追问
Sub test() Dim a(9) As Integer, i As Integer, t as String t="" For i = 1 To 10 a(i - 1) = Range("A" & i) t = t & Range("A" & i) & IIf(i = 10, "}", ",") Next MsgBox t End Sub