Hi all
I’m trying to do following with a Macro:
I have Column A filled with data (the number of rows changes every time).
I want to put together the content of Column A in groups of 20 in Column B and add some text before. It’s working with the following macro but there is a problem. For the last row with data in column B it adds a space behind for each empty cell it finds until 20. Does anyone how to avoid that?
Sub split_into_ groups()
For j = 1 To Range("A").End(xlUp).Row Step 20
Sheets("Sheet1").Cells(j, 2) = “My text” & Join(Application.Transpose(Sheets("Sheet1").Cells(j, 1).Resize(20)))
Next
End Sub
Thanks!
I’m trying to do following with a Macro:
I have Column A filled with data (the number of rows changes every time).
I want to put together the content of Column A in groups of 20 in Column B and add some text before. It’s working with the following macro but there is a problem. For the last row with data in column B it adds a space behind for each empty cell it finds until 20. Does anyone how to avoid that?
Sub split_into_ groups()
For j = 1 To Range("A").End(xlUp).Row Step 20
Sheets("Sheet1").Cells(j, 2) = “My text” & Join(Application.Transpose(Sheets("Sheet1").Cells(j, 1).Resize(20)))
Next
End Sub
Thanks!