Calculating age by taking the input

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eklavyavats
    New Member
    • May 2007
    • 24

    Calculating age by taking the input

    Can anyone tell how can we calculate the age of a person by taking the present date from the user and reading the date of birth from the excel sheet.
    I am using macro in excel to do the job.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Why u need to take user input for present date.
    Cant u use systemdate.
    and if u are used to macros ,it should be straight forward approach for you.

    Comment

    • mailderemi
      New Member
      • Jun 2007
      • 14

      #3
      Originally posted by eklavyavats
      Can anyone tell how can we calculate the age of a person by taking the present date from the user and reading the date of birth from the excel sheet.
      I am using macro in excel to do the job.
      first make a TextBox for full date then you need a parsing code for exporting year of birth then calculate it:
      [CODE=vb]Dim YearOfBirth as Integer
      Text1.text = Year(Date) - YearOfBirth[/CODE]

      Comment

      • eklavyavats
        New Member
        • May 2007
        • 24

        #4
        Originally posted by debasisdas
        Why u need to take user input for present date.
        Cant u use systemdate.
        and if u are used to macros ,it should be straight forward approach for you.

        Actually the time user wants to see that after the particular period. So the user will enter the date and I will calculate the time accordingly. So in this case systemdate will not be of any use.

        Comment

        Working...