Hi,

One way - change the C5:X23 range as necessary or better still set it with a variable that detects the data range

Sub singlerow()
    Dim lLastRow As Long, lLastCol As Integer, lCols As Long, lRows As Long
    Dim r As Range, c As Range, lCounter As Long
    Set r = Range("C5:X23")

    lLastRow = r.Rows.Count
    lLastCol = r.Columns.Count

    With r
        For lRows = 1 To lLastRow
            For lCols = 1 To lLastCol
                If LCase(.Cells(lRows, lCols)) = "x" Then
                    Range("D29").Cells(1, lCounter) = .Cells(lRows, lCols).Offset(-2, 0)
                    lCounter = lCounter + 1
                End If
            Next lCols
        Next lRows
    End With
 
End Sub