Hello,
I developed two macros that insert a function into a cell only if two cells' dates are equal to each other. If this is true, the macros will divide the annual cost by 12.
Here are the two macros:
Sub Macro1()
Range("J16").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-5]=R[-1]C,RC[-6]/12)"
Range("J17").Select
End Sub
sub Macro2()
Range("K17").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-6]=R[-2]C,RC[-7]/12)"
Range("K18").Select
End Sub
The solution as a result from the macros is displayed in GREEN.
An example of the table is attached to this email.
I am trying to develop code that will add the previous month's cost into the next month's cost value which would represent the RED cell values in the table. It will be ending with the 12th month after the GREEN cell which would equal the annual cost.
Any help would be greatly appreciated.
Bookmarks