My brain is fried on this one - I can't get through this 'simple' logic.
I have (2) dates:
aDate
bDate - this will always be equal to or up to 4 or 5 days > (after) aDate
Desired logic:
If the Month of aDate = Month of bDate, then leave both dates as they are.
If the Month of bDate is > the Month of aDate, then keep aDate the same and make bDate = the last day of the month of aDate.
Sample input & results:
These Dates will not be resident in an Excel worksheet, so I need this code in VBA form. Thank you!
I have (2) dates:
aDate
bDate - this will always be equal to or up to 4 or 5 days > (after) aDate
Desired logic:
If the Month of aDate = Month of bDate, then leave both dates as they are.
If the Month of bDate is > the Month of aDate, then keep aDate the same and make bDate = the last day of the month of aDate.
Sample input & results:
Code:
Sample (A) Input
aDate = 09/27/01
bDate = 09/29/01
Sample (A) result
aDate = 09/27/01
bDate = 09/29/01
Code:
Sample (B) Input
aDate = 09/27/01
bDate = 10/02/01
Sample (B) result
aDate = 09/27/01
bDate = 09/30/01
These Dates will not be resident in an Excel worksheet, so I need this code in VBA form. Thank you!