Я докажу образец кода, который может вам помочь:
Option Explicit
Sub test()
Dim LastRow As Long, i As Long, KMS As Long, AdditionalValue As Long
Dim Vehicle As String
Dim stDate As Date
With ThisWorkbook.Worksheets("Sheet1")
LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
For i = 2 To LastRow
AdditionalValue = 50
stDate = .Range("A" & i).Value
Vehicle = .Range("B" & i).Value
KMS = .Range("C" & i).Value
Do Until stDate = Date
KMS = KMS + AdditionalValue
stDate = stDate + 1
Loop
.Range("D" & i).Value = KMS
Next i
End With
End Sub
Результаты:
