小罗非
发表于 2022-1-26 23:28:29
F3设常规格式:=LOOKUP(ROW(A1)-1,MMULT((ROW($1:$4)>COLUMN($A:$D))*1,C$3:C$6*D$3:D$6),B$3:B$6)&"-"&INT(COUNTIF(F$2:F2,LOOKUP(ROW(A1)-1,MMULT((ROW($1:$4)>COLUMN($A:$D))*1,C$3:C$6*D$3:D$6),B$3:B$6)&"-*")/LOOKUP(ROW(A1)-1,MMULT((ROW($1:$4)>COLUMN($A:$D))*1,C$3:C$6*D$3:D$6),D$3:D$6))+1&TEXT(MOD(COUNTIF(F$2:F2,LOOKUP(ROW(A1)-1,MMULT((ROW($1:$4)>COLUMN($A:$D))*1,C$3:C$6*D$3:D$6),B$3:B$6)&"-*"),LOOKUP(ROW(A1)-1,MMULT((ROW($1:$4)>COLUMN($A:$D))*1,C$3:C$6*D$3:D$6),D$3:D$6))+1,"-00")
下拉。
丐版樱木
发表于 2022-1-27 20:24:16
如果VBA处理的话会简单多了。
潘少爷
发表于 2022-1-30 21:19:20
这个题目上个月就有人问了,用函数写局限性实在是太大了,公式写出来只能适用目前的数据而且繁琐复杂。
代码是非常简洁的,而且好理解。可以叫勇哥给你写个通用的代码
流氓猪大
发表于 2022-2-1 17:56:54
勇哥,能否给我 代码
蓝色妖娥子
发表于 2022-2-9 04:54:47
来个 V BA
糖果娱乐影音
发表于 2022-2-15 15:00:00
幢号总楼层单层套数
124 1-1-01
252 1-1-02
333 1-1-03 Private Sub CommandButton1_Click()
1-1-04 n = 3
1-2-01 Range("f3:f65536").ClearContents
1-2-02 For x = 3 To Range("b65536").End(xlUp).Row
1-2-03 For y = 1 To Cells(x, "c")
1-2-04 For z = 1 To Cells(x, "d")
2-1-01 Cells(n, "f") = Cells(x, "b") & "-" & y & "-" & Format(z, "00")
2-1-02 n = n + 1
2-2-01 Next
2-2-02 Next
2-3-01 Next
2-3-02 End Sub
2-4-01
2-4-02
2-5-01
2-5-02
3-1-01
3-1-02
3-1-03
3-2-01
3-2-02
3-2-03
3-3-01
3-3-02
3-3-03
夜深人不静
发表于 2022-2-16 02:50:49
诸星当
发表于 2022-2-17 21:52:08
感谢各位已解决
唐那个
发表于 2022-2-18 11:11:00
<blockquote>
Sub tex()
Dim i, j, k: n = 3
arr = Range("b2").CurrentRegion
For i = 2 To UBound(arr)
For j = 1 To arr(i, 2)
For k = 1 To arr(i, 3)
Range("f" & n) = arr(i, 1) & "—" & j & "—0" & k
n = n + 1
Next
Next
Next
End Sub
小猪超人哦
发表于 2022-2-22 12:13:29
F3设常规格式:=LOOKUP(ROW(A1)-1,MMULT((ROW($1:$4)>COLUMN($A:$D))*1,C$3:C$6*D$3:D$6),B$3:B$6)&"-"&INT(COUNTIF(F$2:F2,LOOKUP(ROW(A1)-1,MMULT((ROW($1:$4)>COLUMN($A:$D))*1,C$3:C$6*D$3:D$6),B$3:B$6)&"-*")/LOOKUP(ROW(A1)-1,MMULT((ROW($1:$4)>COLUMN($A:$D))*1,C$3:C$6*D$3:D$6),D$3:D$6))+1&TEXT(MOD(COUNTIF(F$2:F2,LOOKUP(ROW(A1)-1,MMULT((ROW($1:$4)>COLUMN($A:$D))*1,C$3:C$6*D$3:D$6),B$3:B$6)&"-*"),LOOKUP(ROW(A1)-1,MMULT((ROW($1:$4)>COLUMN($A:$D))*1,C$3:C$6*D$3:D$6),D$3:D$6))+1,"-00")
下拉。