Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50123

Combine Multiple cells into Single Cells

$
0
0
Hi Guys,

I want to combine multiple cells into a single cell using the Chr(10) operation. The cells that are to be combined are called 'data sets' - they are always 7 cells in size for columns B to H however they are between 1-3 in size for columns A. Each of these cells exist above/below each other in the same column.

TODS = (TopOfDataSet Cell)

Cells(TODS.Row,TODS.Column).Value = Cells(TODS.Row + 1,TODS.Column).Value & Chr(10) & Cells(TODS.Row + 2,TODS.Column).Value & Chr(10) & _
Cells(TODS.Row + 3,TODS.Column).Value & Cells(TODS.Row + 4,TODS.Column).Value & Cells(TODS.Row + 5,TODS.Column).Value & _
Cells(TODS.Row + 6,TODS.Column).Value & Cells(TODS.Row + 7,TODS.Column).Value

The tricky bit to it is finding the TODS cell, as there can be multiple Datasets cascaded on top of one another

Regards
Attached Files

Viewing all articles
Browse latest Browse all 50123

Trending Articles