Attribute VB_Name = "Module1" Public Function ALVPaiva(ByVal Pvm As Date) As Date Dim ALVPvm As Date ALVPvm = DateAdd("m", 2, Pvm) ALVPvm = DateSerial(Year(ALVPvm), Month(ALVPvm), 15) ALVPaiva = ALVPvm End Function Public Sub TestaaALVPaiva() Dim Rivi As Long For Rivi = 2 To 40 ActiveSheet.Range("B" & Rivi).Value = ALVPaiva(ActiveSheet.Range("A" & Rivi).Value) Next Rivi End Sub