用下面的VBA代码运行一下就会在当前工作表的 A列填充出全部组合
VBA代码用法:
'按alt+f11进入VBE编辑窗口,然后选择插入----模块----会打开一个模
'块窗口,把下面的代码复制进去--保存,再次按alt+f11返回excel窗口
'按alt+f8打开运行宏窗口,会看到test宏,运行它就可以了
Option Explicit
Sub test()
Dim i As Integer, j As Integer, l As Integer, n As Integer, k As Long
For i = 0 To 9
For j = 0 To 9
For l = 0 To 9
For n = 0 To 9
k = k + 1
ActiveSheet.Range("a" & k) = "'" & i & j & l & n
Next
Next
Next
Next
End Sub
温馨提示:答案为网友推荐,仅供参考