Combine multiple lines of content into one.

Cheval bleu -  
 Superpat -
Hello,

I need to fix an Excel table created by someone who knew even less than I do. Since the text in one of the columns was too long to be visible on one line, this person continued it on the line below. So, each record spans multiple lines, making it impossible for me to modify the sort of the data according to my needs.

My table covers more than 4000 lines, I tried to create a macro by hitting the "Record Macro" button. But I only managed to delete information. Can someone suggest a macro?

The column A contains a sequential number for each record, and column E contains the text to be merged; here’s what the macro should do:

1. Find the first empty cell in column A
2. Move the cursor to column E
3. Cut the text in that cell
4. Move the cursor to the cell above
5. Paste the clipboard content after the existing text without deleting anything
6. Bring the cursor back to the cell below (which is now empty)
7. Delete the line
8. Repeat the process until the end of the table.

Configuration: Windows 7 / Firefox 21.0

6 réponses

Littlegreg Posted messages 9 Registration date   Status Membre Last intervention   2
 
Hard to say without the table, but it seems to me that there is something simpler than a macro.

There is a formula to combine multiple cell contents; it's the concatenate function...
Try something like this in your column F:
=concatenate(B1;C1.D1)

See what it gives you and apply this function to what you want.
2
Superpat
 
I have nothing against the idea of "concatenating" -- I'm seeing this word for the first time -- but my table has more than 4000 rows.
0
Littlegreg Posted messages 9 Registration date   Status Membre Last intervention   2
 
I don't think it's a problem. Once the first line is correct, you just need to copy and paste to make the 4000 lines... then if the result is satisfactory, you have to copy and paste as values... this way the function disappears and only the concatenated content will remain (if the cells are empty, it won't block the concatenation).
0