excel - 如何使用 Excel 脚本将动态范围转换为表格?
问题描述
我是使用带有电源自动化功能的 excel 脚本的新手。试图将一些数据转换为表格。问题是每次的行数都会不同。
我已经在 excel 桌面上完成了这项工作,但不知道如何使用 excel 脚本来完成。
解决方案
问题是在 excel(Office 脚本)中找到使用的范围。一旦你有了它,我假设你知道如何将它转换为表格。
function main(workbook: ExcelScript.Workbook)
{
// Get the current, active worksheet.
let currentWorksheet = workbook.getActiveWorksheet();
// Get the range containing all the cells with data or formatting.
let usedRange = currentWorksheet.getUsedRange();
// Log the range's address to the console.
console.log(usedRange.getAddress());
}
链接供您参考
推荐阅读
- angular - 在Angular的子组件中替换父组件的元素
- matlab - 努力收敛到欧拉数
- regex - 使用 bash 脚本从字符串中提取多个匹配的子字符串
- python - 为什么按钮在我的代码中保持按下状态?
- java - 如何从命令行运行 Intellij 项目
- oracle - SQL DEVELOPER 中的 SELECT 语句
- php - PHP 致命错误:未捕获的错误:不能使用 stdClass 类型的对象作为数组
- r - 识别功能在R中不准确
- python - 无法从“termcolor”导入名称“colored”
- r - 如何使用服务器端逻辑切换dashboardHeader中的禁用(TRUE / FALSE)参数?