1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Excelテーブルを動的に作成する

1
Last updated at Posted at 2025-09-22

はじめに

Power Automateの Excelの「テーブルを作成」 アクションは、テーブルが設定されていないExcelからデータを読み取る際に利用します。

一見すると A1:D20 のように固定範囲しか指定できないように見えますが、実は Excel関数を使って動的に範囲指定することも可能です。

これを利用すると、追加データに応じて自動で広がるテーブルを作成できます。

設定例

「テーブルを作成」アクションでは、Table rangeという範囲指定の項目があります。
ここに直接Excel関数を書き込むことができます。
Outputs.png
下記を入力ください。

書き方
=OFFSET(Sheet1!A1,0,0,LOOKUP(2,1/(Sheet1!A:A<>""),ROW(Sheet1!A:A)),COUNTA(Sheet1!1:1))

数式の意味

Sheet1
シート名を想定

OFFSET(Sheet1!A1, … )
A1セルを基点に、可変的な範囲を返す

LOOKUP(2,1/(Sheet1!A:A<>""),ROW(Sheet1!A:A))
A列の最終行番号を取得

COUNTA(Sheet1!1:1)
1行目の列数をカウント → 列数を自動で決定

注意

アクションが実行された後反映まで少し時間がかかります。

まとめ

・Excelテーブルを動的に指定する方法はある
・OFFSET + LOOKUP + COUNTA の組み合わせで、追加データにも対応できる!

...

色々調べていて、上記にたどり着いたので共有(更新昨年ぶりですね、ハイ)…

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?