Thank you. I inserted the code int the sheet modul but I don't know how to link up it with the 'AgeValue' macro. The code is:
Sub AgeValue()
Dim a
Dim I As Variant
On Error Resume Next
With Range("T8", Range("T" & Rows.Count).End(xlUp)).Resize(, 12)
a = .Value
For I = 1 To UBound(a, 1)
If a(I, 1) = "" Or a(I, 1) = "-" Then
a(I, 12) = ""
Else
a(I, 12) = _
"=""Age is ""&DATEDIF(RC[-11],TODAY(),""Y"")&"" Years, ""&DATEDIF(RC[-11],TODAY(),""YM"")&"" Months and ""&DATEDIF(RC[-11],TODAY(),""MD"")&"" Days"""
End If
Next
.Value = a
.Value = .Value ' optional: convert formula to value
.Columns.AutoFit
End With
Range("Aa:Ad").EntireColumn.Hidden = True
End Sub
Please guide me.
Thank you.
Regards,
Mukesh
Bookmarks