I am new to programming in general. Using VBA I am trying to loop through range("b6:b18"). Through each pass I am subtracting b3
from the value, and putting a date in a cell, and offsetting by one column until the value is less than b3
. Basically I am trying to set up auto payments. Example: I have 5 accounts. 250.36, 17.23, 96.12, 600.00, 5.46. My payment is 36.12 a month. So, 1/1/13 = 36.12 until the first account is < 36.12. But each month must equal the payment. There may be money subtracted from each account in one month.
The code I can't figure out is:
pmt = b3
for each cell in range("b6:b18")
if cell.value > pmt then
activecell.value= cell.value -pmt
activecell =activecell.offset(0,1)
But that code does nothing when closed with next endif, and I don't know how to display the dates in sequential order.