Untitled
unknown
plain_text
3 years ago
812 B
8
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 = 17 'Q column
For i = 4 To lastRow
If Cells(1, startingCol).Value = "VO" Then
For col = startingCol To ActiveSheet.Cells(1, Columns.Count).End(xlToLeft).Column
If Cells(1, col).Value = "VO" Then
If IsEmpty(Cells(i, "G")) Then
Cells(i, "G").Value = Cells(i, col).Value
Else
Cells(i, "G").Value = Cells(i, col).Value
End If
End If
Next col
Else
Cells(i, "G").Value = Cells(i, "S").Value
End If
Next i
End Sub
Editor is loading...