Untitled

 avatar
unknown
plain_text
2 years ago
618 B
4
Indexable
Sub SummarizeColumns()
    Dim lastRow As Long
    lastRow = ActiveSheet.Cells(Rows.Count, "Q").End(xlUp).Row
    Dim col As Long
    Dim startingCol As Long
    startingCol = 18 'R column
    For i = 4 To lastRow
        Cells(i, "H").Value = "" 'clear existing data in H column
        col = 17
        Do While Cells(1, col).Value = "VO"
            For col = startingCol To ActiveSheet.Cells(1, Columns.Count).End(xlToLeft).Column Step 2
                Cells(i, "H").Value = Cells(i, "H").Value + Cells(i, col).Value
            Next col
            col = col + 1
        Loop
    Next i
End Sub
Editor is loading...