Hi All,
Hoping to find a way to concatenate rows with variable numbers of columns using a macro to automate the process.
And example is:
with the desired output to be:
So in essence, I need a macro to concatenate all the USED cells in a row starting at column C (and moving to the right), and the output of that concatenation entered into column B.
(in my example above, i have concatenated with a separator as well ", "
If this can also be included then that would be fantastic, but not required.
The total dataset is completely variable. There could be 50,000 rows, or there could be 50, and some of the rows could have up to 80 columns.
If anyone can help me with this, it would be greatly appreciated.
Thanks so much all
Hoping to find a way to concatenate rows with variable numbers of columns using a macro to automate the process.
And example is:
Excel Workbook | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | Row 1 | Data1 | Data2 | ||||
2 | Row 2 | Data1 | |||||
3 | Row 3 | Data1 | Data2 | Data3 | |||
4 | Row 4 | Data1 | Data2 | ||||
5 | Row 5 | Data1 | Data2 | Data3 | |||
6 | Row 6 | Data1 | Data2 | ||||
7 | Row 7 | Data1 | |||||
... |
with the desired output to be:
Excel Workbook | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | Row 1 | Data1, Data2 | Data1 | Data2 | |||
2 | Row 2 | Data1 | Data1 | ||||
3 | Row 3 | Data1, Data2, Data 3 | Data1 | Data2 | Data3 | ||
4 | Row 4 | Data1, Data2 | Data1 | Data2 | |||
5 | Row 5 | Data1, Data2, Data 3 | Data1 | Data2 | Data3 | ||
6 | Row 6 | Data1, Data2 | Data1 | Data2 | |||
7 | Row 7 | Data1 | Data1 | ||||
... |
So in essence, I need a macro to concatenate all the USED cells in a row starting at column C (and moving to the right), and the output of that concatenation entered into column B.
(in my example above, i have concatenated with a separator as well ", "
If this can also be included then that would be fantastic, but not required.
The total dataset is completely variable. There could be 50,000 rows, or there could be 50, and some of the rows could have up to 80 columns.
If anyone can help me with this, it would be greatly appreciated.
Thanks so much all