在Excel中用VBA编写宏查找一个排列组合

2024-12-30 20:34:44
推荐回答(2个)
回答1:

x = 1 'sheet1的坐标
n = 1 '排序值
y = 1 'sheet2的坐标
Sheet1.Activate
Do While Not Sheet1.Cells(x, 1) = ""
Do While Cells(x, 1) <> n
x = x + 1
Loop
Sheet2.Cells(y, 1) = Sheet1.Cells(x, 1)
y = y + 1
If n = 3 Then n = 1 Else n = n + 1:
x = x + 1
Loop

回答2:

看不懂