Php でのワークシートのコピーと移動

Aspose.Cells - ワークシートのコピーと移動

ワークブック内でワークシートをコピーする

を使用してワークシートをコピーするにはAspose.Cells PHP で for Java、 電話copy_worksheet方法コピーワークシートモジュール。以下にコード例を示します。

PHP コード

 # Create a Worksheets object with reference to the sheets of the Workbook.

$sheets = $workbook->getWorksheets();

\# Copy data to a new sheet from an existing sheet within the Workbook.

$sheets->addCopy("Sheet1");

\# Saving the modified Excel file in default (that is Excel 2003) format

$workbook->save($dataDir . "Copy Worksheet.xls");

ワークブック内でワークシートを移動する

を使用してワークシートを移動するにはAspose.Cells PHP で for Java、 電話move_worksheet方法コピーワークシートモジュール。以下にコード例を示します。

PHP コード

 # Get the first worksheet in the book.

$sheet = $workbook->getWorksheets()->get(0);

\# Move the first sheet to the third position in the workbook.

$sheet->moveTo(2);

\# Saving the modified Excel file in default (that is Excel 2003) format

$workbook->save($dataDir . "Move Worksheet.xls");

実行中のコードをダウンロード

ダウンロード**ワークシートのコピーと移動 (Aspose.Cells)**以下のソーシャルコーディングサイトのいずれかから: