Design Principles:

InteresujÄ…ce rzeczy:

Sub GroupsToString()
    Dim LastCol As Integer
    Dim LastRow As Long
    Dim Group As Range
    Set Group = Range("B2:B39")
 
    LastCol = ActiveSheet.UsedRange.Columns(ActiveSheet.UsedRange.Columns.Count).Column
    LastRow = 39
 
    For c = 2 To LastCol
        For r = 2 To LastRow
            If ActiveSheet.Cells(r, c) = "x" Then
                ActiveSheet.Cells("43", c) = ActiveSheet.Cells("43", c) & ":" & ActiveSheet.Cells(r, "A")
            End If
        Next r
    Next c
End Sub