We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Desktop Grid - Formula Calculation by Columns (Not cell by cell)

Hi

Can we set formula for columns?

e.g. To set column C as sum of column A and column B values of corresponding rows?

like

sheet.Columns(“C”).SetCellValue("=A + B")

Is it possible to perform such an operation?

Hi,

Well, you need to loop through the cells in a column range and specify the formula string accordingly for your requirements:

e.g..,

Dim sheet As Aspose.Grid.Desktop.Worksheet = Me.grdDataEntry.Worksheets(0)
Dim cell As Aspose.Grid.Desktop.GridCell
Dim i As Integer
For i = 0 To 10
cell = sheet.Cells(i, 0)
cell.SetCellValue("your formula goes here")

Next

Thank you.