copy all data from non blank cells

neveu

Board Regular
Joined
Jan 27, 2009
Messages
225
hello forum,
could you please help me with the following chalenge:?

i have some data on column L to Y (displayed on rows).
i want to copy all data from the rows into cell L.

for example:

L M N O
row1 x y s
row2 a 9
row3
row4 v

the problem is that i have 70 lines and the formatting that I've programmed takes 1 minute.

is there a way to make a VBA loop to copy all the information to cell in L until it finds a space on the column

also, it should skip the blank row ( meaning if the cell from L column is blank - first cell )

any help is much appreciated
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Doesn't make much sense, can you provide an example of before and after?
 
Upvote 0
hello Dan,

i'm soryy if my explanation where confusing.
as suggested I'm adding the images stating the before and after status.

thank you

before

Uploaded with ImageShack.us


after

Uploaded with ImageShack.us
 
Upvote 0
Unfortunately, I can't access those links from work. You may want to try Excel Jeanie or PM me.
 
Upvote 0
Hello,
I'm not able to install any software either.
tha't why i'm using this onle solutin for print screens.

did you tried adding the link to trusted sites? for me works in most of the cases.

can you suggest another online program i can use that you can access afterwards?
 
Upvote 0
Try:
Code:
Sub MyConcatenate()
Dim i As Long, j As Long
Dim holdstring As String
Application.ScreenUpdating = False
j = 12
For i = 2 To Range("L" & Rows.Count).End(xlUp).row
    
    Do
        holdstring = holdstring & " " & Cells(i, j)
        j = j + 1
    Loop While Len(Cells(i, j)) > 0
    
    Cells(i, 12) = Trim(holdstring)
    Range(Cells(i, 13), Cells(i, j)).ClearContents
    
    j = 12
    holdstring = ""
    
Next i
Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,636
Messages
6,120,666
Members
448,977
Latest member
moonlight6

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top