helo there..
i have a problem to calculate with formula.
i have more than 50 columns on my spread, and i want to set formula on , let's say range 15th columns to 20th columns.
i replaced column name of my spread with as same as my data set column name.
when i write this code :
int ColStart = ColIdx - 5;
String lbl = ActiveSheet.Columns[ColStart].Label.ToString();
//ColStart is index of start of the range of colloumn to ColIdx.
//lbl and lb2, i used this string so that i can get the label of the column, but it doesn't work.
String lb2 = ActiveSheet.Columns[ColIdx].Label.ToString();
//CollIdx is index of the column i want to set the formula
ActiveSheet.Columns[ColIdx].Formula = "SUM("+lbl+"1:"+lb2+"1)";
i get an error like this : Invalid token was encountered.\nError offset: 4
after debuging, i thought that it was because of the label name that i get from the column name.
How can i changet the label into character label, so that i can used that formula? like this may be : "SUM("AA1 : AZ1")"
or , was there anything else of solving this problem? please help me.
Let me show u what i want on spread web :
JANUARY FEBRUARY MARCH TOTAL
10% 10% 10% 30%
20 % 20% 20% 60%
the formula is set into total column.
thx for helping.