Is this what you want? I'm just guessing.
Sub test()
Dim i As Integer, j As Integer, a As Range
Dim Rng As Range, rng2 As Range
i = 0: j = 0
With Sheets("Sheet1")
For Each Rng In .Range("D5:D" & .Cells(Rows.Count, 4).End(xlUp).Row)
j = j + 1
If Rng.Value = 1 Then
For Each rng2 In Rng.Offset(, 1).Resize(1, 5)
i = i + 1
If rng2 = 1 Then
Set a = .Cells.Find(what:="Date " & i, lookat:=xlWhole, MatchCase:=False)
i = 0: Exit For
End If
Next
.Cells(10, 19).Copy a.Offset(j)
End If
Next
End With
End Sub
By the way, you need to fill E6 to I9 with the same formula you have in E5 to I5
Bookmarks