How to get start and end of previous month in VB
问题 Im trying to create some VB code that will get the start and end of the previous month. Im able to the current month which is just: Month(DateValue(Now)) which would return 3. From there I can take away 1 to give me 2 meaning February. This is fine but what about when I Im in January and I repeat this and it gives me zero - my code will fail. Any one know how to get the previous months start and end day then? Thanks 回答1: The first day of the previous month is always 1, to get the last day of