✔ 最佳答案
其中一個做法:
Dim Printed() As Integer
Dim tmp As Integer
Dim i As Integer
Dim j As Integer
Dim BlnRepeat As Boolean
ReDim Printed(0)
Do While UBound(Printed) <> 26
VBA.Randomize
tmp = Int(VBA.Rnd * 26 + 1)
BlnRepeat = False
For j = 1 To UBound(Printed)
If Printed(j) = tmp Then
BlnRepeat = True
Exit For
End If
Next
If BlnRepeat = False Then
ReDim Preserve Printed(UBound(Printed) + 1)
Printed(UBound(Printed)) = tmp
End If
Loop
For i = 1 To 26
Debug.Print Printed(i)
Next