Copy values

Closed
Taty - Jun 12, 2010 at 11:37 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Jun 12, 2010 at 05:53 PM
Hello, I would like to have a Macro that is doing this

I have values in a column :

3333
4444
5555
6666

and I want to copy them in a row with spaces between:

3333 4444 5555 6666

Any idea ?

2 responses

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Jun 12, 2010 at 03:17 PM
You mean in one cell with space ? or different columns
Also how many rows are you talking about, There is a limit to text in a cell and number of columns
0
I need 32 times of 4 digits numbers in one cell/line ( I hope it is allowed !!!) :
e.g.
1111 2222 3333 4444 5555 6666.............................3232
0
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Jun 12, 2010 at 05:53 PM
Try this. It assumes that the column is A and there are no blank cell in between


Sub JoinData()
Dim lRow As Long

    lRow = 2
    
    Do While (Cells(lRow, "A") <> "")
    
        Cells(1, "A") = Cells(1, "A") & " " & Cells(lRow, "A")
    
        Cells(lRow, "A").Delete Shift:=xlUp
    
    Loop

End Sub
0