'试一下:
Private Sub Command1_Click()
Dim a(1 To 10) As String
Dim i As Integer,j As Integer
For i = 1 To 10
Randomize
a(i) = Chr(Int(26 * Rnd) + 65)
If i > 1 Then
For j = 1 To i - 1
If a(i) = a(j) Then Exit For
Next
End If
If j < i And i > 1 Then i = i - 1
Next
MsgBox Join(a,",")
End Su