how can i add a formula to dt and apply it to the whole column and to the whole row

use write range and the value will be the formula (in english)…

@rpa3 - based on your question, it sounds like you want a formula to be added in EXCEL, correct? And you want it to autopopulate similar to how excel does? So for example if your formula in C1 is A1 + B1, then you’d want row 100 to be A100 + B100, correct?

If so I would use excel itself to accomplish this and not worry about adding it to the datatable itself. Use the write range activity to write all data from the datatable into excel. Next, use the ‘write cell’ activity to add the formula in your desired column in the first row (cell C1 in the example above). Next, use the ‘Auto Fill Range’ activity to populate the rest of the column with the formula. Source range is the cell you used for the ‘write cell’ activity. FillRange is the rest of the rows in the same column, which can be found with datatable.rows.count

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.