Page 1 of 1

repeat a merge of cells through multiple rows

Posted: Tue Mar 25, 2008 4:23 pm
by highway
Hi,
I have a spreadsheet with multiple columns and rows of data.
I want to merge the contents of two of the columns into one column, without losing the contents of either.

I can do this easily on a row my row basis manually, by highlighting the two cells (e.g. A1 and A2), clicking on the merge cells button in the toolbar, and answering yes to the "Should the contents of the hidden cells be moved into the first cell" dialogue box.

The problem is that i need to do this for approx 12000 rows (i.e. B1/B2, C1/C2, D1/D2, etc, etc)

Does anyone know of a method of doing this automatically. Also, i obviously would need to automate the clicking of "yes" at the dialogue box mentioned above. I tried recording a macro, which works for the few cells that i manually did while recording, but i cannot figure out how to get it to transcend through all the rows merging the two cells in each row as it goes.

Any help/suggestions appreciated.
Thank you very much.
Highway.

Re: repeat a merge of cells through multiple rows

Posted: Tue Mar 25, 2008 4:55 pm
by Villeroy
Do the merge by formula:
=$A1&" "&$B1
in C1 concatenates the contents of this row's A and B with intermediate space. Copy down.

Re: repeat a merge of cells through multiple rows

Posted: Tue Mar 25, 2008 7:26 pm
by highway
Thank you for the prompt response, that formula worked brilliantly.

I'm very grateful.
Highway.