Show contents 

Tab > Tab Assembly Interfaces > ITabSheet > ITabSheet.AdjustRangeAddress

ITabSheet.AdjustRangeAddress

Syntax

AdjustRangeAddress(Address: String, SourceCell: ITabRange, DestinationCell: ITabRange): String;

Parameters

Address — the cell range address, which should be corrected.

SourceCell — the source cell during correction.

DestinationCell — the destination cell during correction.

Description

The AdjustRangeAddress method adjusts the relative cell range address during moving a formula.

Example

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Tab: ITabSheet;
Begin
    Tab := UiTabSheet1.TabSheet;
    Tab.Cell(00).Value := 10;
    Tab.Cell(01).Value := 20;
    Tab.Cell(02).Value := 30;
    Tab.Cell(03).Value := 40;
    Tab.Cell(10).Formula := "= Sum(a0: c0)";
    Tab.Cell(11).Formula := "= Sum(" + Tab.AdjustRangeAddress("A0:C0", Tab.Cell(10), Tab.Cell(11)) + ")";
End Sub Button1OnClick;

As a result for the cell "A1" will be set a formula, adding up the values of cells in the range "A0:C0". After this the formula will be corrected for the cell "B1".

See also:

ITabSheet