[Solved] Set a range with 1 parameter as variable
Posted: Mon Jan 15, 2018 4:01 am
Hi,
I am trying to insert a formula to every row, calculating sum of several cells in the same row. By the moment of automatic insertion I will only know columns, while row numbers would be variable, so I need to add something like:
[A0] = [SUM(N0:T0)]
[A1] = [SUM(N1:T1)]
What's the right syntax?
I am trying to insert a formula to every row, calculating sum of several cells in the same row. By the moment of automatic insertion I will only know columns, while row numbers would be variable, so I need to add something like:
[A0] = [SUM(N0:T0)]
[A1] = [SUM(N1:T1)]
Code: Select all
oSheet.getCellByPosition(myCol, j).formula = "=SUM("N" & j & ":T" & j)"