Visual Basic (Declaration) | |
---|---|

Public Property Formula As String |

Visual Basic (Usage) | Copy Code |
---|---|

Dim instance As Row Dim value As String instance.Formula = value value = instance.Formula |

C# | |
---|---|

public string Formula {get; set;} |

#### Property Value

String containing the formulaSet this property to a mathematical expression made up of cell references, operators, and functions (either provided or custom functions you define). For a list of the operators and functions you can use in formulas, refer to the Formula Reference.

The Spread component can use absolute or relative cell references. You define the cell reference style for the spreadsheet by using the ReferenceStyle property. The formula cannot contain both absolute and relative row or column references.

Returning the value of the Formula property provides a string containing the written expression of the formula, for example, SUM(A1:B1). However, if you have changed the cell reference style to a style that cannot represent the formula, the Spread component provides the formula with question marks as placeholders for cell references that cannot be represented.

For more information about formulas, refer to the Formula Reference.

C# | Copy Code |
---|---|

```
FarPoint.Win.Spread.Row r;
fpSpread1.ActiveSheet.SetValue(0, 0, 10);
fpSpread1.ActiveSheet.SetValue(1, 0, 10);
r = fpSpread1.ActiveSheet.Cells[2, 0].Row;
r.Formula = "A1 + A2";
``` |

Visual Basic | Copy Code |
---|---|

Dim r As FarPoint.Win.Spread.Row FpSpread1.ActiveSheet.SetValue(0, 0, 10) FpSpread1.ActiveSheet.SetValue(1, 0, 10) r = FpSpread1.ActiveSheet.Cells(2, 0).Row r.Formula = "A1 + A2" |

**Target Platforms:** Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2