Range Specification

The following methods convert range specifications.

Range Specification Methods

Method

Purpose

TextToRange

Converts a range specification, e.g. 'A1..C5', into a CGXRange object, e.g. CGXRange(1,1,5,3).

RangeToText

Converts a CGXRange object, e.g. CGXRange(1,1,5,3), into a range specification, e.g. 'A1..C5'.

Keep in mind the following points about these range specification methods:

  • The range object must not be a row, column, or table range. Don't use SetRows(), SetCols(), or SetTable() for specifying the range. Use only plain cell ranges.
  •  

    CGXRange rg;

    TextToRange((_T("A1..C5"), rg));

  • You can use CString functions to transform a string that you get as a result of RangeToText(). For example:
  •  

    CString s;

    CGXFormulaSheet::RangeToText(CGXRange(1,1,10,4),

    s.GetBuffer(20), 20);

    s.ReleaseBuffer();

    You can use string functions to convert absolute cell references in formula cells to the appropriate form.

    See Cell Referencing in Objective Grid for more information about absolute and relative cell references. See Ranges for more information about ranges.