吴雪友
发表于 2021-10-20 02:00:13
Sub 统计()
Dim ar, br(), m, i
= Empty
ar = Range("B2:F12")
ReDim br(1 To UBound(ar), 1 To UBound(ar, 2))
For i = 1 To UBound(ar)
If Len(ar(i, 1)) Then
m = 0
n = n + 1
For j = 1 To UBound(ar, 2)
If Len(ar(i, j)) Then
m = m + 1
br(n, m) = ar(i, j)
End If
Next
End If
Next
.Resize(n, UBound(ar, 2)) = br
End Sub
赵尚志部队
发表于 2021-10-20 09:39:08
去掉空格提取内容
自立
发表于 2021-10-21 00:11:10
=IFERROR(INDEX(B:B,SMALL(IF($B$2:$B$12<>"",ROW($B$2:$B$12),),ROW(A1))),"")
三建右下拉
醉疯数码
发表于 2021-11-5 10:49:56
好像不对啊
真源笑笑生
发表于 2021-11-6 16:15:27
看错了,撤回。
大画家
发表于 2021-11-15 00:17:26
=INDEX(B:B,SMALL(IF($B$2:$B$12="",99,ROW($2:$12)),ROW(A1)))&""数组三键下拉。
快人快语
发表于 2021-11-17 23:33:38
经过测试能达到最终结果。
用户一叶遮目
发表于 2021-11-27 13:54:34
=FILTER(B2:F12,B2:B12<>"")
祁汉
发表于 2021-11-30 21:13:19
使用公式的话,去公式板块吧
学会放下自己
发表于 2021-12-3 21:52:44
Sub 统计()
Dim ar, br(), m, i
= Empty
ar = Range("B2:F12")
ReDim br(1 To UBound(ar), 1 To UBound(ar, 2))
For i = 1 To UBound(ar)
If Len(ar(i, 1)) Then
m = 0
n = n + 1
For j = 1 To UBound(ar, 2)
If Len(ar(i, j)) Then
m = m + 1
br(n, m) = ar(i, j)
End If
Next
End If
Next
.Resize(n, UBound(ar, 2)) = br
End Sub