Value 屬性
傳回或設定指定範圍的值。可讀寫 Variant
語法
範例
範例
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 to previous
Workbook.Sheets[1].Cells.Item[1, 1].Value := 3.14159;
This example is the same to 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 to previous
With Workbook.Sheets[1].Range['A1', 'F1'] do
Offset[1,0].Value := Value;
This example demonstrates using of Formulas
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;