I got a funny problem with a part of my macro.
Basically I got a big datafile with a lot of columns with data. In columns "O" (15) there is a "date" in the following format; yyyyww, for example 201648 which is the year 2016 in the week 48. In column "AB" (28) there is another column where I in my code filling the rows with some data. If column "O" is the start week of an event then column "AB" is the start week of the preparation for the event which always will be 1 week earlier than the start week of event (Column O). Therefore my code was taking the "date" in column "O" minus 1 week which will be correct most of the times. 201648 - 1 = 201647. The problem is that if for example the start week in column "O" is 201701 then my date in column "AB" will be 201700 which obviously is wrong. Instead it should give me 201652 since year 2016 is a total of 52 weeks. Is there a way to work around this?
Bookmarks