Hello Everyone,
I believe this will probably be one of the last I ask for in a while, hopefully
I am looking for a macro that will allow you to combine data horizontally (by columns) but NOT vertically (by rows) of single or multiple SELECTED cells in Column A.
1.) I would like to be able to do this by simply SELECTING one or more cells in Column A and the macro will know to look to the RIGHT of the selection in COLUMN A and will take any data found in that selected Column A row and will add it to the end of the data found in Column A.
2.) I would like this macro to retain the cells background fill color in Column A, meaning don't remove the fill color.
3.) I would like this macro to add a SINGLE SPACE between each piece of combined text added to the Column A row.
(See Example #1 Below)
Note:
The specific row numbers shown in the following example, are just an example, I would like this to be able to be applied to any SELECTED Column A Rows.
EXAMPLE #1
BEFORE
|____A____|____B____|____C____|
1 apple____orange____banana
2 apple____orange____banana
3 apple______________banana
4 _________orange____banana
5 apple____orange____banana
6 apple____orange__________
If you SELECT Column A's cells 2,3,4 and 6 and apply the macro you would get
AFTER
|____A____|____B____|____C____|
1 apple____orange____banana
2 apple orange banana
3 apple banana
4 orange banana
5 apple____orange____banana
6 apple orange
Notice rows 1 and 5 remain the same because they were NOT selected.
Notice in row 3 there is only a single space between apple and banana .
Notice in row 4 there is not a space at the beginning.
The handling of these two "space" issues can be achieved by adding the following links macro to this macro.
https://www.mrexcel.com/forum/excel-questions/991831-remove-extra-spaces-within-cells.html
Thank You to anyone who reads this and to anyone who provides a solution.
Any questions, please let me know.
I believe this will probably be one of the last I ask for in a while, hopefully
I am looking for a macro that will allow you to combine data horizontally (by columns) but NOT vertically (by rows) of single or multiple SELECTED cells in Column A.
1.) I would like to be able to do this by simply SELECTING one or more cells in Column A and the macro will know to look to the RIGHT of the selection in COLUMN A and will take any data found in that selected Column A row and will add it to the end of the data found in Column A.
2.) I would like this macro to retain the cells background fill color in Column A, meaning don't remove the fill color.
3.) I would like this macro to add a SINGLE SPACE between each piece of combined text added to the Column A row.
(See Example #1 Below)
Note:
The specific row numbers shown in the following example, are just an example, I would like this to be able to be applied to any SELECTED Column A Rows.
EXAMPLE #1
BEFORE
|____A____|____B____|____C____|
1 apple____orange____banana
2 apple____orange____banana
3 apple______________banana
4 _________orange____banana
5 apple____orange____banana
6 apple____orange__________
If you SELECT Column A's cells 2,3,4 and 6 and apply the macro you would get
AFTER
|____A____|____B____|____C____|
1 apple____orange____banana
2 apple orange banana
3 apple banana
4 orange banana
5 apple____orange____banana
6 apple orange
Notice rows 1 and 5 remain the same because they were NOT selected.
Notice in row 3 there is only a single space between apple and banana .
Notice in row 4 there is not a space at the beginning.
The handling of these two "space" issues can be achieved by adding the following links macro to this macro.
https://www.mrexcel.com/forum/excel-questions/991831-remove-extra-spaces-within-cells.html
Thank You to anyone who reads this and to anyone who provides a solution.
Any questions, please let me know.
Last edited: