Remember, the column should be wide enough to write or merge all the texts in one cell. Else, it will not give you the desired result. However, before using the option, you’ll need to first increase the width of the column. Inside the Home tab (in your Excel worksheet) look for the Fill option. If you are not comfortable with VBA programming or macros, then you can use Excel’s Justify feature. Then you can drag the fill handle to other cells in Column. CONCATENATE (B2, ,C2) You can write the above formula in Cell D2, you will see that both column B and column C have been merged into column D without losing any data. Merge Cells using Excel’s Justify Feature Assuming that you want to merge column B and C into column D, you can use the following formulas: B2&C2. I’ll loop through the Selection object to extract each cells value and concatenate the texts and numbers (if any) and store it in a variable.įinally, I’ll use the Selection object again, to assign the extracted values to a cell (Cells(1) or the first cell in the first row), align it according to my requirement and merge it. The Selection object represents the selected area in the worksheet. In the macro, I am using the Selection object as a Range. First, select or highlight the rows that you wish to merge and then hit the button. Now here's how you will merge all the cells value.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |