HotXLS 文件

Columns 屬性

傳回代表指定範圍中欄的 IXLSColsRange 介面至 TXLSRange 物件。唯讀

語法

property Columns: IXLSColsRange;

範例

此範例顯示工作表一選取範圍中的欄數

With Workbook.Sheets[1].Range['A1', 'F10'] do begin
  Columns[2].Font.Bold := True;
end;
This example copies the values from the second column of range A1:F10 to third

With Workbook.Sheets[1].Range['A1', 'F10'] do begin
  Columns[3].Value := Columns[2].Value;
end;
This example displays the number of columns in the selection on sheet one

MessageDlg('The selection contains ' +
           inttostr(Workbook.Worksheets[1].Selection.Columns.Count) + ' columns.',
           mtInformation, [mbOk], 0);