Option Explicit
Sub TEST2()
Dim ar, br, i&, j&, r&, strJoin$
Application.ScreenUpdating = False
r = Cells(Rows.Count, "B").End(xlUp).Row
ar = Range("B1:K" & r).Value
ReDim br(1 To UBound(ar), 0)
br(1, 0) = "目标信息合计"
For i = 2 To UBound(ar)
br(i, 0) = br(i, 0) & "用户名" & ar(i, 1) & ar(i, 2) & "管理费欠费:"
strJoin = ""
For j = 3 To UBound(ar, 2)
If Val(ar(i, j)) Then strJoin = strJoin & ";" & Replace(ar(1, j), "管理费", "") & ar(i, j) & "元"
Next j
strJoin = Mid(strJoin, 2)
br(i, 0) = br(i, 0) & strJoin
Next i
[L1].Resize(UBound(br)) = br
Application.ScreenUpdating = True
Beep
End Sub
|