private void Form1_Load(object sender, System.EventArgs e)
{
fpSpread1.ActiveSheet.RowCount = 5;
fpSpread1.ActiveSheet.ColumnCount = 2;
fpSpread1.ActiveSheet.Columns[0,1].CellType = new FarPoint.Win.Spread.CellType.NumberCellType();
fpSpread1.ActiveSheet.Columns[1].BackColor = Color.LightYellow;
fpSpread1.ActiveSheet.Columns[1].Width = 120;
fpSpread1.ActiveSheet.SetValue(0, 0, 10);
fpSpread1.ActiveSheet.SetValue(1, 0, 20);
fpSpread1.ActiveSheet.SetValue(2, 0, 30);
fpSpread1.ActiveSheet.SetValue(3, 0, 40);
fpSpread1.ActiveSheet.SetValue(4, 0, 50);
//SUM関数(すべての引数値の和)を設定します
fpSpread1.ActiveSheet.SetFormula(0, 1, "SUM(A1:A5)");
//PRODUCT関数(すべての引数値の積)を設定します
fpSpread1.ActiveSheet.SetFormula(1, 1, "PRODUCT(A1:A5)");
//AVERAGE関数(すべての引数値の平均)を設定します
fpSpread1.ActiveSheet.SetFormula(2, 1, "AVERAGE(A1:A5)");
//セル(0,0)とセル(4,0)の和を設定します
fpSpread1.ActiveSheet.SetFormula(3, 1, "A1 + A5");
//セル(0,0)の値が10より大きければ2を乗算し、そうでない場合は3を乗算します
fpSpread1.ActiveSheet.SetFormula(4, 1, "IF(A1>10, A1*2, A1*3)");
}
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
FpSpread1.ActiveSheet.RowCount = 5
FpSpread1.ActiveSheet.ColumnCount = 2
FpSpread1.ActiveSheet.Columns(0, 1).CellType = New FarPoint.Win.Spread.CellType.NumberCellType
FpSpread1.ActiveSheet.Columns(1).BackColor = Color.LightYellow
FpSpread1.ActiveSheet.Columns(1).Width = 120
FpSpread1.ActiveSheet.SetValue(0, 0, 10)
FpSpread1.ActiveSheet.SetValue(1, 0, 20)
FpSpread1.ActiveSheet.SetValue(2, 0, 30)
FpSpread1.ActiveSheet.SetValue(3, 0, 40)
FpSpread1.ActiveSheet.SetValue(4, 0, 50)
'SUM関数(すべての引数値の和)を設定します
FpSpread1.ActiveSheet.SetFormula(0, 1, "SUM(A1:A5)")
'PRODUCT関数(すべての引数値の積)を設定します
FpSpread1.ActiveSheet.SetFormula(1, 1, "PRODUCT(A1:A5)")
'AVERAGE関数(すべての引数値の平均)を設定します
FpSpread1.ActiveSheet.SetFormula(2, 1, "AVERAGE(A1:A5)")
'セル(0,0)とセル(4,0)の和を設定します
FpSpread1.ActiveSheet.SetFormula(3, 1, "A1 + A5")
'セル(0,0)の値が10より大きければ2を乗算し、そうでない場合は3を乗算します
FpSpread1.ActiveSheet.SetFormula(4, 1, "IF(A1>10, A1*2, A1*3)")
End Sub