发布网友 发布时间:2022-04-28 12:56
共1个回答
热心网友 时间:2023-10-09 14:50
用公式复杂,运行会慢一些,用VBA简单,如果数据太多,可用数组加快速度。见附件
For A1 = 1 To 4
For A2 = 1 To 4
If A1 <> A2 Then
For A3 = 1 To 4
If A3 <> A2 And A3 <> A1 Then
For A4 = 1 To 4
If A4 <> A3 And A4 <> A2 And A4 <> A1 Then
n = n + 1
Cells(n, "B") = Cells(A1, 1) & Cells(A2, 1) & Cells(A3, 1) & Cells(A4, 1)
End If
Next
End If
Next
End If
Next
Next