Hi the following code calculates age as date of birth is entered in column D and puts date on column E.
How could I make the code so that when the user places the date in cell M12, the age gets calculated in cell I14?
Any help would be kindly appreciated.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 4 Then
Target.Offset(, 1).Formula = "=IF(DATEDIF(RC[-1],NOW(),""y"")>0,DATEDIF(RC[-1],NOW(),""y"") & "" years"",IF(DATEDIF(RC[-1],NOW(),""m"")>0,DATEDIF(RC[-1],NOW(),""ym"") & "" months"",DATEDIF(RC[-1],NOW(),""y"")))"
End If
End Sub
How could I make the code so that when the user places the date in cell M12, the age gets calculated in cell I14?
Any help would be kindly appreciated.