I don't fully understand the purpose, but the technical aspect sounds doable (sorta) both in vba and regular functions with some tricks.
However, I'd like to start by noting that excel is not the optimal tool for full automation. I've used it for years, yet it's not as robust as a proper (programming) framework, and particularly inconvenient if it's meant to be used by the average joe (as you imply). Reconsider if possible.
Now, in vba this is a simple task.
- Define sheet "Parms" (name's arbitrary), we'll use A1 as #mons.
- Define sheet "Worksheet", periods go here.
- Alt F11, in sheet(parms) define the following function:
private sub worksheet_change(byval target as range)
if target.row = 1 and target.column = 1 then
_ sheets("Worksheet").range("a2:i10000").clear
_ nrow = target.value + 1
_ sheets("Worksheet").range("a2:i" & nrow).value = "FILLME"
end if
end sub
(Remove the underlines, site trims spaces.)
If the data is automatically generated from a formula you can pull down, use the autofill method. If it's from another sheet, use copy function.
The macro recorder is your new best friend - whatever you need to do, turn on recording, do it then analyse & modify the code generated.
The tricky way is with a layer of formulas:
In the worksheet, wrap a2 with this function,
if(parms!$A$1 >= row(a2) - 1,"FILLME","")
and pull down to say I10000. "FILLME" is the actual function you wanna use, or extract it from another sheet (input!a2) which allows the user to fiddle with it.
A bit less convenient in practice but you'd sidestep the massive headache of explaining how to "enable macros" / certificates.
Thanks for the response! Is there anyway you could write that out in VBA format?
I have to use excel is the problem. I am sure there are much better and simpler ways to do this but I am stuck with Excel at the moment.