Autofill in VBA. Take control of Autofill using vba with this simple macro code example. It takes the data from the range A1:A2 and autifills it to A20. This can be modified to autofill any way you would like using a little macro tweaking. Selection1 is the range with the data to autofill. In the DB function, use absolute references for the cost, salvage, and life arguments, which are listed in the range B3:B5. Use a relative reference for the period argument (cell D4). Fill the range E5:E39 with the formula in cell E4, filling without formatting, to calculate the depreciated value for months 2–36.
Question: Use The Values In The Range A7:A8 To Extend The List Of Years To The Range A9:A11. Use AutoFill To Fill The Range A9:H11 With The Formatting From The Range A7:H8. In Cell B8, Create A Formula Without Using A Function That Multiplies The Value In Cell B7 By The Value In Cell B6 And Then Adds The Value In B7.
Pro tip: use auto fill to the left to fill the series backwards. In these examples, we’ve used the fill handle to go to the right. This increases the number or date. The same thing happens when you use the fill handle to go down. But if you use the fill handle up or to the left, the series fills in backwards.