HotXLS Documentation

Value property

Returns or sets the value of the specified range. Read/write Variant

Syntax

property Value: Variant;

Remarks

If the cell contains a constant, this property returns the constant. If the cell contains a Formula, the Value property returns the calculated result of the Formula

Example

This example sets the value of cell A1 on sheet one to 3.14159

Workbook.Sheets[1].Range['A1', 'A1'].Value := 3.14159;
This example is the same as the previous

Workbook.Sheets[1].Cells.Item[1, 1].Value := 3.14159;
This example is the same as the previous

Workbook.Sheets[1].Cells[1, 1].Value := 3.14159;
This example sets the value of cell A1 on sheet one to PI

Workbook.Sheets[1].Range['A1', 'A1'].Value := '=PI()';
This example copies the values from A1:F1 range to A2:F2 range

With Workbook.Sheets[1] do begin
  Range['A2', 'F2'].Value := Range['A1', 'F1'].Value;
end;
This example is the same as the previous

With Workbook.Sheets[1].Range['A1', 'F1'] do
    Offset[1,0].Value := Value;
This example demonstrates using of Formulae

With Workbook.Sheets[1] do begin
  Range['B1', 'B1'].Value := '=(A1/100)*20';
  Range['B2', 'B2'].Value := '=SUM(A1:B1)';
  Range['B3', 'B3'].Value := '=PI()*A3^2/2';
end;