most
Board Regular
- Joined
- Feb 22, 2011
- Messages
- 107
- Office Version
- 365
- 2019
- Platform
- Windows
- Mobile
I have a problem and need some input from some clever people.
I have some code which does something based on which month it is.
Coloumn 1 - - - - - - - - - - - - - - -Column 2
=MONTH(TODAY())+Z2 - - - - - - -[some code based on the number in column 1, expect number 1-12]
Cell Z2 I use to simulate another month, if it's January and I would like to see February I put in a "1" in Z2. I use a macro to increase or decrease this figure.
Range("Z2") = Range("Z2") - 1
Range("Z2") = Range("Z2") + 1
This works fine for most month of the year, the problem is at turn of the year.
December and I want to see January -> 12+1 = 13 (expect 1)
January and I want to see November -> 1--2 = -1 (expect 11)
Any idea how I can solve this?
regards Marcus
I have some code which does something based on which month it is.
Coloumn 1 - - - - - - - - - - - - - - -Column 2
=MONTH(TODAY())+Z2 - - - - - - -[some code based on the number in column 1, expect number 1-12]
Cell Z2 I use to simulate another month, if it's January and I would like to see February I put in a "1" in Z2. I use a macro to increase or decrease this figure.
Range("Z2") = Range("Z2") - 1
Range("Z2") = Range("Z2") + 1
This works fine for most month of the year, the problem is at turn of the year.
December and I want to see January -> 12+1 = 13 (expect 1)
January and I want to see November -> 1--2 = -1 (expect 11)
Any idea how I can solve this?
regards Marcus
Last edited: