Spread WPF Documentation
SetFormula(Int32,Int32,String) Method
Example 


The row index.
The column index.
The formula to place in the specified cell.
Sets a formula in a specified cell in the specified sheet area.
Syntax
'Declaration
 
Public Overloads Sub SetFormula( _
   ByVal row As System.Integer, _
   ByVal column As System.Integer, _
   ByVal formula As System.String _
) 
'Usage
 
Dim instance As Worksheet
Dim row As System.Integer
Dim column As System.Integer
Dim formula As System.String
 
instance.SetFormula(row, column, formula)
public void SetFormula( 
   System.int row,
   System.int column,
   System.string formula
)

Parameters

row
The row index.
column
The column index.
formula
The formula to place in the specified cell.
Example
This example uses the SetFormula method.
gcSpreadSheet1.Sheets[0].SetValue(0, 0, 1);
gcSpreadSheet1.Sheets[0].SetValue(0, 1, 2);
gcSpreadSheet1.Sheets[0].SetValue(1, 0, 10);
gcSpreadSheet1.Sheets[0].Cells[1, 1].Formula = "sum(A1:C1)";
gcSpreadSheet1.Sheets[0].SetFormula(3, 1, "A1+A2");
gcSpreadSheet1.Sheets(0).SetValue(0, 0, 1)
gcSpreadSheet1.Sheets(0).SetValue(0, 1, 2)
gcSpreadSheet1.Sheets(0).SetValue(1, 0, 10)
gcSpreadSheet1.Sheets(0).Cells(1, 1).Formula = "sum(A1:C1)"
gcSpreadSheet1.Sheets(0).SetFormula(3, 1, "A1+A2")
Requirements

Target Platforms: Windows 7, Windows 8 Desktop, Windows Vista SP1 or later, Windows Server 2000, Windows 2000 Professional (SP4), Windows XP (SP2), Windows 2008, Windows 2003 Server (SP1)

See Also

Reference

Worksheet Class
Worksheet Members
Overload List

 

 


Copyright © GrapeCity, inc. All rights reserved.