通过使用 excel,我需要创建从 0000 到 ZZZZ 的 4 个字母/数字的字母数字序列。我创建了一个小宏,如下所示:
Sub a()
Dim iChar1 As Integer, iChar2 As Integer, iChar3 As Integer, iChar4 As Integer
Dim sOutput As String
For iChar1 = 65 To 90
For iChar2 = 65 To 90
For iChar3 = 65 To 90
For iChar4 = 65 To 90
sOutput = Chr(iChar1) & Chr(iChar2) & Chr(iChar3) & iChar4
ActiveCell.Value = sOutput
ActiveCell.Offset(1, 0).Activate
Next: Next: Next: Next
End Sub
问题是,由于 ASCII 字符从 65 到 90,因此我只能获得 alpha 序列。相反,我还需要数值(从 48 到 57 的 ASCII)。怎么做?或者,你知道另一种方法吗?