Hi All,

How do I concatenate below with comma if next row have values and ignoring blank from different cell.

untitled.jpg

The result i would like it to show will be 24 RACKS, 30 BOXES, 10 CARTONS.

I have following code from web with the formula
=comb_cells(A1:C1,", ")
However the result was 24, RACKS, 30, BOXES, 10, CARTONS
Can anyone advice how could I modify this code to suit the result i want?


Function comb_cells(r As Range, Optional delim As String = " ") As String

    For Each c In r
        If IsEmpty(c.Value) Then
        Else
            If Len(comb_cells) = 0 Then
                comb_cells = c.Value
            Else
                comb_cells = comb_cells & delim & c.Value
            End If
        End If
    Next

End Function