Xpose twenty rows then the next twent etc.
first, you don't need the MIN
The comma is the separator for the thousands and so you will get a very
great number. Try semicolon as separator if you have numbers in your
range:
Sub SuperJoin()
Dim i As Long, x As Long
For i = 1 To Range("A" & Rows.Count).End(xlUp).Row Step 20
x = x + 1
With WorksheetFunction
Range("B" & x) = Join(Application.Transpose( _
Range(Cells(i, 1), Cells(i + .CountA( _
Range(Cells(i, 1), Cells(i + 19, 1))) - 1, 1))), ";")
End With
Next
End Sub
or comma with a following space:
Sub SuperJoin()
Dim i As Long, x As Long
For i = 1 To Range("A" & Rows.Count).End(xlUp).Row Step 20
x = x + 1
With WorksheetFunction
Range("B" & x) = Join(Application.Transpose( _
Range(Cells(i, 1), Cells(i + .CountA( _
Range(Cells(i, 1), Cells(i + 19, 1))) - 1, 1))), ", ")
End With
Next
End Sub
Regards
Claus B.
Thanks Claus, that cleared it up very nicely. All works excellent.
Regards,
Howard
|