Hi Phil,
I get that, but I was hoping that you would actually post a formula for the first couple of your cells in your row so we could see the best way to achieve your outcome.
Never mind, here's a generic answer, without using VBA, that may , (or may not depending on what your actual formula you need), solve your problem.
Put this formula into B2 and drag it across the row to the maximum number of cells you could need (ie 1 more than maximum value going into A1).
Rich (BB code):
=if(COLUMN() <= $A$1+1, =[put your desired formula here], "")
This will give you <n> cells that have an active formula, and all the remaining cells in the row will return an empty string if the number in A1 is smaller.
If there could be multiple instances of the A1-type box in your s/sheet (specifying number of instances) and thus multiple instances of the B2-B<n> type Row underneath, then simply change the start of the formula to :
Rich (BB code):
=if(COLUMN() <= $A1+1, ...
which means that you can copy the formula to other rows in your sheet as it now checks the value in Column A but 1 row above where the formulas are.
Now if your desired FORMULA itself varies depending on the value in Cell A1 then we might need to use VBA , but I can't tell you that until I see your actual formula.
Cheers,
Warren K.</n></n>