Hello…
I have two worksheets, one with monthly data (‘monthly’ sheet) and the second (‘quarterly’ sheet) with excel formula transferring monthly data into quarterly ones. I have added new rows in the second worksheet. Now I want to extend the formula used in the previous rows and do this via VBA. However, the formula is the sum of every other two rows, which makes the macro difficult to write.
For example, I have following formulas in the quarterly sheet:
.............Column A..........Column B
Row10... 2011-Q1... =SUM(Monthly!B5:B7)
Row11... 2011-Q2... =SUM(Monthly!B8:B10)
Row12... 2011-Q3... =SUM(Monthly!B11:B13)
Row13... 2011-Q4... =SUM(Monthly!B14:B16)
Row14... 2012-Q1... =SUM(Monthly!B17:B19)
Row12... 2012-Q2... =SUM(Monthly!B20:B22)
Row16... 2012-Q3... =SUM(Monthly!B23:B25)
Row17... 2012-Q4... =SUM(Monthly!B26:B28)
Now, I want to extend the formula for one more year as the following, highlighted in red:
.............Column A..........Column B
Row10... 2011-Q1... =SUM(Monthly!B5:B7)
Row11... 2011-Q2... =SUM(Monthly!B8:B10)
Row12... 2011-Q3... =SUM(Monthly!B11:B13)
Row13... 2011-Q4... =SUM(Monthly!B14:B16)
Row14... 2012-Q1... =SUM(Monthly!B17:B19)
Row15... 2012-Q2... =SUM(Monthly!B20:B22)
Row16... 2012-Q3... =SUM(Monthly!B23:B25)
Row17... 2012-Q4... =SUM(Monthly!B26:B28)
Row18... 2013-Q1... =SUM(Monthly!B29:B31)
Row19... 2013-Q2... =SUM(Monthly!B32:B34)
Row20... 2013-Q3... =SUM(Monthly!B35:B37)
Row21... 2013-Q4... =SUM(Monthly!B38:B40)
I have to do this for 30 workbooks and it is extremely helpful if I can just run the macros to do the work.
Help and thanks in advance!
Bookmarks