This handy VBA procedure is just to show you how we can calculate and display someone Age. To do this, of course we need to know their date of birth first, then simply using datediff and mod vba functions we can calculate how old is he/she.
Sub PersonAge()
Dim iYears As Integer, iMonths As Integer, iMonth As Integer
Dim dtDateofbirth As Date
dtDateofbirth = _
CDate(InputBox("Input your date of birth (yyyy-mm-dd)", "Date of birth"))
iYears = DateDiff("yyyy", CDate(dtDateofbirth), Date)
iMonths = (DateDiff("m", CDate(dtDateofbirth), Date)) Mod (iYears * 12)
MsgBox "Your age are " & iYears & " year(s) and " & iMonths & " month(s)"
End Sub
For this example, I use MsgBox and InputBox to get input and display the output data, but we can change it to worksheet cells reference if we want to integrate this calculation in our Excel Worksheet.
Pingback: klonopin
Pingback: Ephedrin Kanada
Pingback: Mehr Infos
Pingback: buy scrapebox list
Pingback: GPT Surf
Pingback: Queens Carpet Cleaners
Pingback: learn about it support denver
Pingback: The phone lookup
Pingback: Vij De Video
Pingback: outdoor gazebo
Pingback: Blitz Media Marketing
Pingback: payday loans online
Pingback: read this
Pingback: usb breathalyzer
Pingback: www.easyloanfast.com
Pingback: free quotes about life
Pingback: link
Pingback: h2go
Pingback: costco coupon site
Pingback: Symbol LS 4278 Barcode Scanner
Pingback: crucifix
Pingback: servis char
Pingback: check this out
Pingback: diabetic bags
Pingback: alpharetta tree removal
Pingback: visit site
Pingback: free standing boxing bag