VBA - Getting first day of the month.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi.

I'm familiar with the first day of week, year, etc functions. But I have yet
to come across a good function or suggestion to default to the first day of
the month when given a particular month.

Can anyone help out on this? [in VBA]

Thanks,
Chris
 
chriscooz said:
I'm familiar with the first day of week, year, etc functions. But I have yet
to come across a good function or suggestion to default to the first day of
the month when given a particular month.

Can anyone help out on this? [in VBA]


Use the DateSerial function.

First of month:
DateSerial(year, month, 1)

Last day in month:
DateSerial(year, month + 1, 0)
 
Back
Top