Backup your data.
Run: AddLotTotals
If I've misunderstood what you want, reply back and I'll try to fix it.
Sub AddLotTotals()
Dim rgRaw As Range, nLastSummaryRow As Long, rgCell As Range, sAddress As String
Dim ws As Worksheet
With Worksheets("VIC RAW")
Set rgRaw = .Range("A1:A" & Cells(.Rows.Count, "A").End(xlUp).Row)
End With
Set ws = Worksheets("VIC SUMMARY")
With ws
nLastSummaryRow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With
Set rgCell = rgRaw.Find(What:="Lot Total", _
LookIn:=xlValues, _
Lookat:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not rgCell Is Nothing Then
sAddress = rgCell.Address
Do
nLastSummaryRow = nLastSummaryRow + 1
ws.Cells(nLastSummaryRow, "A") = rgRaw.Cells(rgCell.Row, "A")
Set rgCell = rgRaw.FindNext(rgCell)
Loop While Not rgCell Is Nothing And sAddress <> rgCell.Address
End If
End Sub
Bookmarks