View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Need to insert formulas into certain cells when row inserted

Dim vArr as variant, j as long, i as long
varr = Array(1,2,3,6,9,12)
j = 1
for i = lbound(varr) to ubound(varr)
cells(6,i).Formula = "=Lower(Text($L6+" & varr(i) & ",""mmm""))"
Next


--
Regards,
Tom Ogilvy



"Jason" wrote in message
...
I have a spread sheet that I have an active x control, but need to insert

formulas into columns N:S when I insert a new row. The formulas would be in
order from N to S as follow. I am new so I apologize, but I really need this
written. Thanks.
with N

=CHOOSE(MONTH($L6+1,"jan","feb","mar","apr","may", "jun","jul","aug","sep","o
ct","nov","dec","jan","feb","mar","apr","may","jun ","jul","aug","sep","oct",
"nov","dec")
with O

=CHOOSE(MONTH($L6)+2,"jan","feb","mar","apr","may" ,"jun","jul","aug","sep","
oct","nov","dec","jan","feb","mar","apr","may","ju n","jul","aug","sep","oct"
,"nov","dec")
with P

=CHOOSE(MONTH($L6)+3,"jan","feb","mar","apr","may" ,"jun","jul","aug","sep","
oct","nov","dec","jan","feb","mar","apr","may","ju n","jul","aug","sep","oct"
,"nov","dec")
with Q

=CHOOSE(MONTH($L6)+6,"jan","feb","mar","apr","may" ,"jun","jul","aug","sep","
oct","nov","dec","jan","feb","mar","apr","may","ju n","jul","aug","sep","oct"
,"nov","dec")
with R

=CHOOSE(MONTH($L6)+9,"jan","feb","mar","apr","may" ,"jun","jul","aug","sep","
oct","nov","dec","jan","feb","mar","apr","may","ju n","jul","aug","sep","oct"
,"nov","dec")
with S

=CHOOSE(MONTH($L6)+12,"jan","feb","mar","apr","may ","jun","jul","aug","sep",
"oct","nov","dec","jan","feb","mar","apr","may","j un","jul","aug","sep","oct
","nov","dec")