Hi.
I need to calculate date range. Until then beauty. More when I run the program exits not the exact calculation:
Example: Date of birth: 26/11/1988
Current Date: 26/08/2012
Correct Score: 23
Program Result: 24
What I realized is that getting the range of years and not the entire date for calculation.
Would pick up the entire range "dd / mm / yyyy"?
Code:Sub Teste() Dim Nascimento As Date, AnoAtual As Date, Idade As Double, Idade2005 As Date, Idadeem2005 As Double Nascimento = InputBox("Enter the date of birth:") AnoAtual = InputBox("Enter the Current Year:") Idade = DateDiff("yyyy", Nascimento, AnoAtual) Idade2005 = "31 / 12 / 2005" Idadeem2005 = DateDiff("yyyy", Nascimento, Idade2005) MsgBox "Essa pessoa tem: " & Idade & Chr(13) & _ "His age in 2005 will be: " & Idadeem2005 End Sub


Reply With Quote

