小弟借oobird版大的程式碼稍作修改
Sub yy()
i = 1
Do
aa = Cells(i, 2).CurrentRegion.Rows.Count
b = Cells(i, 2).Resize(aa, 1)
If aa = 1 Then
Cells(i, 3) = b
Else
Cells(i, 3) = Join(Application.Transpose(b), ",")
End If
i = i + aa + 1
Loop Until Cells(i, 2) = ""
End Sub
回復 1#aoss98
Sub Ex()
Dim C As Range
For Each C In Range("B:B").SpecialCells(xlCellTypeConstants).Areas
C.Cells(1, 2) = Join(Application.Transpose(C), ",")
Next
End Sub