[VBA ] 函數(formula)的問題
我要在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