VBA - Getting first day of the month.

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
 
M

Marshall Barton

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top