You can actually just fill the entire range with the same formula at one shot, Excel will adjust the formula as per relative/absolute references:
or whatever your formula is. If you want the value in B2 to drive the length of the formula, you could use the worksheet_change event:
Just pay attention to the absolute/relative referencing in your formula. Here, cell B3 is locked in, A3 will vary with the position of the formula.
Edit:
Hmmmm...
If you decrease the value in B2, you might want to drop the trailing formulas:
Put this right after the "ActiveSheet... =" line.
Bookmarks