【问题标题】:How do you convert a dynamic range into a table using Excel Scripts?如何使用 Excel 脚本将动态范围转换为表格?
【发布时间】:2021-11-03 14:36:37
【问题描述】:

我不熟悉将 excel 脚本与电源自动化一起使用。试图将一些数据转换为表格。问题是每次的行数都会不同。

我已经在 excel 桌面上完成了这项工作,但不知道如何使用 excel 脚本来完成。

【问题讨论】:

  • 请用输入和所需输出的具体示例更新此问题。
  • 请添加您的 excel 桌面示例
  • 请提供足够的代码,以便其他人更好地理解或重现问题。

标签: excel power-automate office-scripts


【解决方案1】:

问题是在 excel(Office Scripts) 中找到使用的范围。一旦你有了它,我假设你知道如何将它转换为表格。

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());
}

Link供您参考

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-28
    • 2014-04-09
    相关资源
    最近更新 更多