作者gundan (钢弹)
看板Visual_Basic
标题[VBA ] 函数(formula)的问题
时间Wed Jun 22 15:22:23 2011
我要在vba中写formula
我知道可以用
sheet.cells(1,4).formula="=sum(A1:C1)"
cells(1,4)就是D1
但是现在我的程式可能是要让D1=A1加到C1
或是E1=A1加到D1,D或E是前面的程式决定的
也就是
dim v as integer
v=4 ' or 5,6,7,....
for i = 1 to 10
sheet.cells(i,v).formula=.......
next i
那串.......我想让他从cells(i,1)加到cells(i,v-1)
请问有人会吗?谢谢!
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.219.200.162