Red over White
Board Regular
- Joined
- Jul 16, 2011
- Messages
- 129
- Office Version
- 365
- Platform
- MacOS
I am trying to write a VBA program where actions are dependent on what the current month is. In the example below, in February, May, August or November one set of actions will happen and in the remaining months another set of actions will occur.
If the macro was run today, I would be looking for the program to be picking up on the “=11” element.
What I’m struggling what is what the correct TODAY/MONTH combination for this to happen, bearing in mind I use UK date formats. I have tried various combinations of TODAY, MONTH and DATE, with and without brackets, but have not had any success
If TODAY/MONTH combination = 2 Or 5 Or 8 Or 11 Then
One set of actions
End if
If TODAY/MONTH combination <> 2 Or 5 Or 8 Or 11 Then
Another set of actions
End if
If someone does come up with a solution, I would be grateful if they could clarify if I need to put leading zeroes in front of the single digit months in readiness for next year.
Thanks
If the macro was run today, I would be looking for the program to be picking up on the “=11” element.
What I’m struggling what is what the correct TODAY/MONTH combination for this to happen, bearing in mind I use UK date formats. I have tried various combinations of TODAY, MONTH and DATE, with and without brackets, but have not had any success
If TODAY/MONTH combination = 2 Or 5 Or 8 Or 11 Then
One set of actions
End if
If TODAY/MONTH combination <> 2 Or 5 Or 8 Or 11 Then
Another set of actions
End if
If someone does come up with a solution, I would be grateful if they could clarify if I need to put leading zeroes in front of the single digit months in readiness for next year.
Thanks