private void Form1_Load(object sender, System.EventArgs e)
{
fpSpread1.Sheets.Count = 2;
//相互シート参照を有効にします
fpSpread1.EnableCrossSheetReference = true;
fpSpread1.Sheets[0].DefaultStyle.CellType = new FarPoint.Win.Spread.CellType.NumberCellType();
fpSpread1.Sheets[0].SetValue(0, 0, 1000);
fpSpread1.Sheets[0].SetValue(1, 0, 2000);
fpSpread1.Sheets[0].SetValue(2, 0, 3000);
fpSpread1.Sheets[0].SetValue(3, 0, 4000);
fpSpread1.Sheets[0].Cells[0, 0, 3, 0].BackColor = Color.LightPink;
fpSpread1.Sheets[1].DefaultStyle.CellType = new FarPoint.Win.Spread.CellType.NumberCellType();
fpSpread1.Sheets[1].SetValue(0, 0, 5000);
fpSpread1.Sheets[1].Cells[0, 0].BackColor = Color.LightCyan;
//「シート1:セル(0,0)〜(3,0)の合計」と「シート2:セル(0,0)」との合計式を設定します
fpSpread1.Sheets[1].SetFormula(1, 1, "SUM(Sheet1!A1:A4) + Sheet2!A1");
fpSpread1.Sheets[1].Cells[1, 1].BackColor = Color.LemonChiffon;
}
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
FpSpread1.Sheets.Count = 2
'相互シート参照を有効にします
FpSpread1.EnableCrossSheetReference = True
FpSpread1.Sheets(0).DefaultStyle.CellType = New FarPoint.Win.Spread.CellType.NumberCellType
FpSpread1.Sheets(0).SetValue(0, 0, 1000)
FpSpread1.Sheets(0).SetValue(1, 0, 2000)
FpSpread1.Sheets(0).SetValue(2, 0, 3000)
FpSpread1.Sheets(0).SetValue(3, 0, 4000)
FpSpread1.Sheets(0).Cells(0, 0, 3, 0).BackColor = Color.LightPink
FpSpread1.Sheets(1).DefaultStyle.CellType = New FarPoint.Win.Spread.CellType.NumberCellType
FpSpread1.Sheets(1).SetValue(0, 0, 5000)
FpSpread1.Sheets(1).Cells(0, 0).BackColor = Color.LightCyan
'「シート1:セル(0,0)〜(3,0)の合計」と「シート2:セル(0,0)」との合計式を設定します
FpSpread1.Sheets(1).SetFormula(1, 1, "SUM(Sheet1!A1:A4) + Sheet2!A1")
FpSpread1.Sheets(1).Cells(1, 1).BackColor = Color.LemonChiffon
End Sub