更新时间2019-06-21 05:32:20
如C列4月3日 D列收款 如何让D列成为4月3日收款
Sub 合并()
Dim arr
On Error Resume Next
arr = Range("a1:c" & Range("a" & Rows.Count).End(xlUp).Row + 1)
For a = 2 To Range("a" & Rows.Count).End(xlUp).Row
If arr(a, 2) <> "" Then
c = a + 1
b = arr(c - 1, 3)
Do
If arr(c, 2) <> "" Or c > Range("a" & Rows.Count).End(xlUp).Row Then Exit Do c = c + 1
b = b & "," & arr(c - 1, 3)
Loop
Cells(a, 4) = b
End If
Next
End Sub试一试看,能不能符合你的要求。