去掉空格提取内容
去掉空格提取内容(最好用公式)使用公式的话,去公式板块吧 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 去掉空格提取内容
=IFERROR(INDEX(B:B,SMALL(IF($B$2:$B$12<>"",ROW($B$2:$B$12),),ROW(A1))),"")
三建右下拉 好像不对啊 看错了,撤回。 =INDEX(B:B,SMALL(IF($B$2:$B$12="",99,ROW($2:$12)),ROW(A1)))&""数组三键下拉。 http://127.0.0.1/data/attachment/forum/202202/08/155228rm082i372r8oz01z.png
经过测试能达到最终结果。 =FILTER(B2:F12,B2:B12<>"")