Sub Meciacov()
Dim PoleD(), PoleM() As Integer, i As Long, MM As Integer, Dnes As Date, R As Long
With ThisWorkbook.Worksheets("Hárok1")
Dnes = .Cells(2, 12)
R = .Cells(.Rows.Count, "C").End(xlUp).Row - 1
PoleD = .Cells(2, 3).Resize(R).Value
ReDim PoleM(1 To UBound(PoleD))
For i = LBound(PoleD) To UBound(PoleD)
PoleM(i) = (Year(Dnes) - Year(PoleD(i, 1))) * 12 + Month(Dnes) - Month(PoleD(i, 1))
Next i
.Cells(2, 4).Resize(R).Value = Application.Transpose(PoleM)
End With
End Subcitovat