Is there anyway to calculate age between the textbox I mean I have onetextbox to let the user enter DOB (dd/mm/yyyy) and another textbox will popout the result of the age. I'm kindda new in VBA Excel would like some help ty :)
Printable View
Is there anyway to calculate age between the textbox I mean I have onetextbox to let the user enter DOB (dd/mm/yyyy) and another textbox will popout the result of the age. I'm kindda new in VBA Excel would like some help ty :)
Welcome to the forum!
In your userform code:
Code:Private Sub TextBox1_Change() Dim a() As String
On Error Resume Next
a() = Split(TextBox1.Value, "/")
TextBox2.Value = DateDiff("yyyy", DateSerial(a(2), a(1), a(0)), Date) - 1
End Sub