ExcelScript.RangeCopyType enum
注解
示例
/**
* This script copies all of the values from the current worksheet to a new worksheet.
*/
function main(workbook: ExcelScript.Workbook) {
// Get the used range on the current worksheet.
let usedRange = workbook.getActiveWorksheet().getUsedRange();
// Create a new worksheet with a default name.
let newSheet = workbook.addWorksheet();
// Copy the values from the used range to the new worksheet.
let copyType = ExcelScript.RangeCopyType.values; /* Change this to copy different information, such as formats. */
let targetRange = newSheet.getRangeByIndexes(
usedRange.getRowIndex(),
usedRange.getColumnIndex(),
usedRange.getRowCount(),
usedRange.getColumnCount());
targetRange.copyFrom(usedRange, copyType);
// Switch the view to the new worksheet.
newSheet.activate();
}
字段
all | |
formats | |
formulas | |
link | |
values |
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈