Forum Discussion
IT990
May 26, 2023Copper Contributor
Concatenate above cells into the blank cell below
Hi, I am trying to have replace the blank cell (which is essentially a subtotal cell) with a concatenation of the above cells. Unfortunately there is a random number of cells above each blank. se...
- May 26, 2023
Select the range, including the blank cell at the end.
Then run this macro:
Sub FillTheBlanks() Dim r1 As Long Dim r2 As Long Application.ScreenUpdating = False r1 = 1 For r2 = 2 To Selection.Rows.Count If Selection.Range("A" & r2).Value = "" Then Selection.Range("A" & r2).Value = Application.TextJoin(", ", _ True, Selection.Range("A" & r1 & ":A" & r2)) r1 = r2 + 1 End If Next r2 Application.ScreenUpdating = True End Sub
IT990
May 26, 2023Copper Contributor
Thanks for all the responses. I used HansVogelaar's one and it works perfectly.