The following code places the age in column "E" when the date of birth is written in column "D"
How could I change the code so that it places the age in cell "I14" when the date of birth is written in cell "K9"
Any help on this would be kindly appreciated.
Thanks in advance.
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
Any help on this would be kindly appreciated.
Thanks in advance.