tags:

views:

456

answers:

3

Is it possible to manipulate the components (year, month, day) of a date in VBA? I'd like a function that, given a day, a month, and a year, returns the corresponding date.

+1  A: 

There are several date functions in VBA - check this site

DateSerial(YEAR, MONTH, DAY)

Nescio
+3  A: 
DateSerial(YEAR, MONTH, DAY)

would be what you are looking for.

DateSerial(2008, 8, 19) returns 8/19/2008

Swati
+1  A: 

You want DateSerial:

Dim someDate As Date = DateSerial(year, month, day)
Prestaul