合作共嬴
发表于 2021-12-31 07:44:48
根据14楼大大的代码,修改了下。初学者,只能依葫芦画瓢。
如果扩展,替换下A列。比如到S列,就替换“$R$200”为“$S$200”。
喜猹
发表于 2022-1-2 12:36:33
代码确实是简单又好用,蹩脚的代码
Sub tc()
Dim arr, i, j, k: l = 2
arr = Range("a1").CurrentRegion
For i = 2 To UBound(arr)
For j = 1 To arr(i, 2)
For k = 1 To arr(i, 3)
Cells(l, 6) = Cells(i, 1) & "座-" & j & 0 & k
l = l + 1
Next
Next
Next
End Sub
嗮的却黑
发表于 2022-1-4 00:31:16
曾经奔跑的你厉害,我昨晚就在思索int跟mod能不能合在一起,被你搞定了哈。
龚少
发表于 2022-1-5 10:15:45
F2
=INDEX(A:A,SMALL(IF($B$2:$B$6*$C$2:$C$6>=TRANSPOSE(ROW(INDIRECT("1:"&MAX($B$2:$B$6*$C$2:$C$6)))),ROW($2:$6)),ROW(1:1)))&"座-"&ROUNDUP((COUNTIF($F$1:F1,INDEX(A:A,SMALL(IF($B$2:$B$6*$C$2:$C$6>=TRANSPOSE(ROW(INDIRECT("1:"&MAX($B$2:$B$6*$C$2:$C$6)))),ROW($2:$6)),ROW(1:1)))&"*")+1)/INDEX(C:C,SMALL(IF($B$2:$B$6*$C$2:$C$6>=TRANSPOSE(ROW(INDIRECT("1:"&MAX($B$2:$B$6*$C$2:$C$6)))),ROW($2:$6)),ROW(1:1))),)&TEXT(MOD(ROW(1:1)-1,INDEX(C:C,SMALL(IF($B$2:$B$6*$C$2:$C$6>=TRANSPOSE(ROW(INDIRECT("1:"&MAX($B$2:$B$6*$C$2:$C$6)))),ROW($2:$6)),ROW(1:1))))+1,"00")
下拉