I am trying to write a VBA function that would do the following in my attachment:
1. the range is Sheet!2D5:Sheet!2L5
2. if D5 <= Sheet!1C6, then D5 = (the previous cell+Sheet!1C8)
3. if D5 = Sheet!1C6, then D5 = the previous cell
4. The above command (command 3) has to go cell by cell in the specified range, UNTIL the year over the cell, as specified by row 4 is equal to the one in Sheet1!C9 (in this case, the year is 7, so cell I5)
5. cells I5 through L5 have to be multiplied by a given fraction so that L5 = 0
obviously this needs to be some sort of a dynamic loop/function.... This is urgent please help!
Bookmarks