x = Format(Date, "0")
y = Format(CDate([B18].Value), "0")
If x = y Then
[B7] = [B18]: [C7] = [C18] + 1: [D7] = [B7] & "R" & [C7]
Else: [B7] = Format(Date, "0"): [C7] = 1: [D7] = [B7] & "R" & [C7]
End If
For i = 8 To 18
Cells(i, "B") = Cells(i - 1, "B")
Cells(i, "C") = Cells(i - 1, "C") + 1
Cells(i, "D") = Cells(i, "B") & "R" & Cells(i, "C")
Next