![]() It accounts for columns and rows and will work with normal formulas. Nikki says: Decemat 8:36 pm This is the macro I use. The closest i have come is with a previous post: 1. Ie I want a finished sheet of one column with the same number of rows but the columns from each row meged into the first cell of each row. By the way, we can modify this code to handle merging across a single row instead of down a column.įor example, i want to be able to run the macro by selecting all rows in my worksheet, but have columns merged per row, not all rows and columns merged into one cell in teh top left of the sheet. (basically make it wide enough) If this instruction is followed, then there would be no need to wrap the text. Adjust the column width so that you can fit all contents in one cell. I left it in (because you included it), but why are you setting the WrapText property to True? The reason I asked why were you setting the the WrapText property to True was because of this instruction you gave above. Sub JoinAndMerge ' Joins all the content in selected cells ' and puts the resulting text in top most cell ' then merges all cells Const Delimiter = ' ' On Error Resume Next With Selection.Item(1).Value = Join(WorksheetFunction.Transpose(Selection), Delimiter).Item(2).Resize(Selection.Count - 1). = xlGeneral.VerticalAlignment = xlCenter.WrapText = True End With End Sub I have a question though. Below is your code modified to remove the loop which concatenates the output text together (note that this method does not produce a trailing delimiter in the output string like your code does). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |