SetRefStyle Method
Applies To
fpSpread control
Description
Sets the reference style used by the control to represent formulas and custom names.
Syntax
void CSpreadSheet::SetRefStyle (long RefStyle);
fpSpread.SetRefStyle(ByVal RefStyle As Long)
Parameters
The following parameters are available:
Parameter | Description | |
---|---|---|
RefStyle | Reference style Use one of the following values: |
|
Description | Example | |
(Default) Uses letters and numbers for column and row coordinates; letters and numbers represent absolute coordinates, number sign (#) represents the current column or row | A1, B#, #2 | |
Constant: RefStyleDefault | ||
Uses letters and numbers for column and row coordinates; uses dollar sign ($) for absolute coordinates | $A$1, $B, $2, $B2, C$5, D4 | |
Constant: RefStyleA1 | ||
Uses "R" and number for row, "C" and number for column coordinates; [ ] for relative coordinates, "C" or "R" without a number represents the current row or column | R1C1, RC2, R4C[3], R[2]C4, RC[-2] |
|
Constant: RefStyleR1C1 |
Remarks
The fpSpread control can use relative or absolute references for formulas. The default is absolute references that do not change when copied to another position. The default reference style lets the user indicate the current row or column using the number sign (#).
This method is applied to the entire workbook, including all sheets in the control.
RefStyleA1 provides relative references. The user can also specify absolute references using a dollar sign before the column or row coordinate. This reference style emulates Microsoft Excel.
RefStyleR1C1 uses row and column number coordinates and allows relative references, which are specified by brackets.
Your formula cannot contain both absolute and relative row or column references. For example, the following formula to add the values in the first column up to the current row is invalid.
fpSpread1.Formula = "sum(A1:A#)"
Likewise, the following formula to add the values in the first row up to the current column is invalid.
fpSpread1.Formula = "sum(A1:#1)"
Spread Designer
Choose the Calculation menu, the Reference Style menu, and then the Reference Style tab in the Calculation Settings dialog box.
Parameter | Items on Reference Style tab |
---|---|
RefStyle | Option buttons under Reference Style |
Return Type
None
See Also
ReCalcCell, GetRefStyle method
DLL Correspondence
SSSetRefStyle function