全て
| カテゴリ未分類
| 通常
| 数学
| 投資
| 副業
| 転職・就職
| ブログ
| 株Stock
| VBA
| SharePoint
| REST API
| RenderListDataAsStream
| PowerAutomateDesktop
| Graph API
| PowerApps
| PowerAutomate
| PowerFx
| OfficeScriptオフィススクリプト
| PowerAutomate日時Excel日時相互関係
| PowerShell
| Dataverse
| UiPath
| OneDrive
| LINQ
| VB.NET
| C#.NET
| WPFC#.NET
| Git
async function updateData() { await Excel.run(async (context) => { // アクティブなワークシートを取得 const sheet = context.workbook.worksheets.getActiveWorksheet(); // テーブルを取得(テーブル名を適切なものに置き換えてください) const table = sheet.tables.getItem("Table1"); // テーブルのデータを取得 const tableRange = table.getDataBodyRange(); tableRange.load("values"); // ヘッダー行を取得 const headers = table.getHeaderRowRange().load("values"); // コンテキストの実行 await context.sync(); // テーブルのデータを取得 const tableData = tableRange.values; // ヘッダー行のデータを取得 const headerRow = headers.values[0]; // 製品列のインデックスを見つける const productColumnIndex = headerRow.indexOf('製品'); // 製品列のインデックスが見つかった場合 if (productColumnIndex !== -1 && tableData.length > 0) { // 行番号1の製品データを更新 const productData = '新しい製品データ'; table.rows.getItemAt(0).getRange().getCell(0, productColumnIndex).values = [[productData]]; } // コンテキストの実行(変更を反映) await context.sync(); }); } // 関数を実行 updateData().catch(console.error); お気に入りの記事を「いいね!」で応援しよう
Last updated
2024.02.20 06:38:34
[OfficeScriptオフィススクリプト] カテゴリの最新記事
|