View Single Post
  #4   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
Jeff[_42_] Jeff[_42_] is offline
external usenet poster
 
Posts: 8
Default Use VBA functions in a worksheet?

mmm, that won't work. I was trying to calculate the age of a list of people given their date of
birth. I ended up using some year, month, and day functions.

Assuming the date of birth is in column A, this should calculate the correct age to the day

=(YEAR(TODAY()) - YEAR(A1)) - ((MONTH(TODAY())*100 + DAY(TODAY())) < (MONTH(A1)*100 + DAY(A1)))

If anyone knows a better way to do this please post it. I just wanted a formula I could drag down a
list of birth dates without writing a VBA procedure.

Jeff


"Robin Hammond" wrote in message
...
Jeff,

You don't need it. Try this as a formula:

=NOW()+1

Robin Hammond
www.enhanceddatasystems.com

"Jeff" wrote in message
...
Is it possible to use VBA functions in a worksheet? I'd like to use the
Dateadd() function on a
worksheet.

Jeff