Work out the First & Last Day of the month in VBA

This allows excel to work out the first and last days of the month in vba when passed the current date.

tdate can be set to any date instead of Now and this will work out the first and last day of the month of the date passed.

'Set todays date for the filters to use 'This can be changed to any date you require. tDate = Now FirstofMonth = DateSerial(Year(tDate), Month(tDate), 1) LastofMonth = DateSerial(Year(tDate), Month(tDate) + 1, 1) - 1

Code Snippits