メインコンテンツへスキップ

行を削除する Excel で Power Automate

PDF4me 行を削除する Excel は Power Automate 1 つ以上の行範囲を削除するアクション Excel カンマ区切り範囲構文を使用したワークシート。フローがワークブックと範囲文字列を渡すと、ヘッダー行のトリミング、期限切れレコードの削除、サンプルデータのクリアなどに使用して、クリーンなワークシートを返します。 Excel 次のステップに進むためのファイル準備が完了しました。

このアクションが何をするか

PDF4me 行を削除する Excel 取る Excel ファイルと行範囲文字列を指定して、対象のワークシートから正確にその行を削除します。範囲は、1 つのリクエストで単一の行とハイフンで区切られたスパンを混在させることができます。 PDF4me 常に最も高い行番号から順に削除するため、同じ呼び出し内の以前の範囲がずれることはありません。

関連ブログ記事
この機能に関するブログ記事はまだありません。近日公開予定です。
その間、PDF4me ブログを閲覧して、あらゆるプラットフォームのチュートリアルやワークフローをご覧ください。
ブログをご覧ください →

認証 API リクエスト​

アクセスするには PDF4me ウェブ API を通して Power Automateすべてのリクエストには有効な API キー。認証はあなたの身元を検証し、コネクタがアクセスできるようにします。 PDF4meの Excel フローから行を削除するサービス。

見逃してはならない重要な事実​

行範囲はカンマで区切られた1つの文字列です
1つのフィールドに、単一の行とハイフンで区切られた範囲を組み合わせることができます。例えば、1-5,10,15-20 のように記述します。オプションで、角括弧 [1-5] も 1-5 と同様に使用できます。
削除は常に下から上に実行されます
PDF4meは自動的に最も高い行番号から削除するため、同じリクエスト内の他の範囲が、先に削除された行によって位置がずれることはありません。
ワークシート名は任意です
空白のままにするとワークブックの最初のワークシートが対象となり、大文字と小文字を区別して正確な名前を入力すると特定のシートが対象となります。
Power Automate PDF4me Excelの行削除アクションで、ファイルコンテンツ、ファイル名、ワークシート名、行範囲の各フィールドが表示されます。

前の操作からファイルの内容とファイル名をマッピングし、対象が最初のシートでない場合はワークシート名を設定し、行範囲を入力します。

パラメータ​

必須: ファイルの内容、ファイル名、行範囲は必ず指定する必要があります。ワークシート名は省略可能で、デフォルトでは最初のワークシートが使用されます。

パラメータ必須その機能例
File ContentOptionalContent of the Excel file to process. Map it from the file content returned by a previous action, such as SharePoint or OneDrive Get file content.@{body('Get_file_content')?['$content']}
File NameOptionalName of the Excel file, including its extension (for example `report.xlsx`). Map it from the file name returned by a previous action. Defaults to `DeleteRows.xlsx`.report.xlsx
Worksheet NameOptionalName of the worksheet to delete rows from (empty for all worksheets).your value
Row RangesOptionalRows to delete, as a comma-separated list of row numbers and ranges, for example `1-5,10,15-20`.1-5,10,15-20

行削除を実行すると何が返されますか?​

分野タイプ内容物
Output File ContentFile contentContent of the Excel file with the rows deleted. Map it into the next action, for example the File Content field of SharePoint or OneDrive Create file.
SuccessYes/NoWhether the operation completed successfully
Error MessageTextError message if operation failed
Error DetailsArrayList of detailed error messages

よくあるエラーメッセージ​

エラーメッセージ原因解決
Request is emptyRequest object is null.Provide a valid request object.
Document is emptyDocument object is null.Provide a valid Excel document.
Row ranges are requiredRowRanges is null or an empty string.Provide a valid row range specification.
Invalid worksheet selectionWorksheetName doesn't exist in the workbook.Use an existing worksheet name.
Invalid start row {row}. Row numbers must be positive.Row number is less than 1, such as "0-5" or "-1".Use row numbers of 1 or greater (1-based indexing).
Row {row} exceeds maximum data row ({maxRow})Row number is greater than the worksheet's data row count.Use row numbers within the valid range, 1 to maxRow.
Invalid range {start}-{end}: End row cannot be less than start rowEnd row is smaller than start row, such as "10-5".Make sure the end row is greater than or equal to the start row.
Invalid row range formatMalformed range string that couldn't be parsed.Check the syntax, use commas and hyphens correctly.

行の削除を設定するにはどうすればいいですか Power Automate?​

  1. 追加 PDF4me → 行を削除する Excel あなたの Power Automate 流れ。
  2. 地図 ファイルの内容 そして ファイル名 以前のアクションから、例えば SharePoint または OneDrive ファイルの内容を取得します。
  3. セット ワークシート名 対象が最初のワークシートでない場合は、空欄のままにしてください。
  4. 入力 列範囲 例えば、カンマ区切りの文字列として 1-5,10,15-20。
  5. フローを実行します。行は自動的に下から上に削除され、クリーンアップされたファイルは次のように返されます。 document。

典型的な構成​

ワークフローの例Common Power Automate flow patterns using Delete Rows from Excel.
レポートのヘッダーとフッターのクリーンアップ
  1. 内部レポートがクライアント向けに準備完了とマークされたときに、フローのトリガーが作動します。
  2. ファイルコンテンツを取得すると、レポートが取得されます。 SharePoint。
  3. 行を削除する Excel 行範囲を内部ヘッダーとフッターの行に設定して実行します。たとえば、「1-3,96-100」のように指定します。
  4. クリーニング済みのファイルはクライアントにメールで送信され、元のファイルは別途アーカイブされます。
スケジュールされたトランザクションログのトリミング
  1. 繰り返しトリガーは、毎月のアーカイブフローを実行します。
  2. ファイルコンテンツを取得する Excel トランザクションログ SharePoint。
  3. 前のステップでは、保持期間よりも古い行を特定し、行範囲文字列を動的に構築します。
  4. 行を削除する Excel これらの行を削除し、トリミングされたログは保存されます。 SharePoint。
テンプレートサンプルデータの削除
  1. 新入社員のオンボーディングプロセスは、人事システムから始まります。
  2. ファイルコンテンツの取得は、テンプレートライブラリから経費報告書テンプレートを取得します。
  3. 行を削除する Excel 行範囲が「2-10」に設定され、ワークシート名が「経費」に設定されているサンプル行を削除します。
  4. 修正済みのテンプレートは、1行目のヘッダーがそのままの状態で、新入社員にメールで送信されます。

実践的なヒント​

Count rows before building the range string
Row Ranges rejects any row number past the worksheet's data row count, so confirm the row count first if you are constructing ranges dynamically from another action's output.
Combine ranges in one call instead of looping
A single Row Ranges string like "1-5,10,15-20" deletes multiple spans in one action run, which is simpler to maintain than chaining several Delete Rows actions.
Match Worksheet Name exactly, including case
Worksheet Name comparison is case-sensitive. A mismatch returns an invalid worksheet selection error even if the name looks correct at a glance.
Brackets around a range are optional
Both "1-5" and "[1-5]" are accepted for the same range, so either format works if the string is being generated by another system.
Don't worry about deletion order in the input
You can list ranges in any order in Row Ranges. PDF4me sorts and deletes from the highest row number down automatically to avoid index shifting.

チートシート​

分野価値
ActionDelete Rows from Excel
File ContentMapped from a prior file-retrieval action
File Namee.g. data.xlsx
Worksheet NameBlank = first worksheet, or exact case-sensitive name
Row Ranges format1-based, comma-separated: "1-5,10,15-20"
Deletion orderBottom-to-top automatically, no action needed
OutputProcessed File Content, Success, Error Message, Error Details

よくある質問​

How do I delete rows in Excel using Power Automate?+
Add the PDF4me Delete Rows from Excel action, map File Content and File Name from a prior action, set Worksheet Name if needed, and provide Row Ranges as a comma-separated string such as 1-5,10,15-20. Running the flow returns the Excel file with those rows removed.
What format does Row Ranges use?+
Row Ranges is a comma-separated string using 1-based row numbers. Use a single number for one row, a hyphenated pair for a range, and commas to combine several, for example 1-5,10,15-20 deletes rows 1 through 5, row 10, and rows 15 through 20.
Why are rows deleted bottom-to-top instead of top-to-bottom?+
Deleting from the bottom up prevents index shifting. If rows were removed top-to-bottom, every deletion would shift the remaining row numbers up by one, causing later ranges in the same request to target the wrong rows. See <a href="https://learn.microsoft.com/en-us/office/vba/api/excel.range.delete" target="_blank" rel="noopener noreferrer">Microsoft's Excel Range.Delete reference</a> for how row shifting works natively in Excel.
What happens if a row range is invalid?+
The action returns Success as false with an ErrorMessage describing the problem, for example a row number that exceeds the worksheet data row count, or a range where the end row is smaller than the start row. No rows are deleted when the request fails validation.
Can I delete rows from a worksheet other than the first one?+
Yes. Set Worksheet Name to the exact, case-sensitive name of the target worksheet. Leaving it blank defaults to the first worksheet in the workbook. See <a href="https://learn.microsoft.com/en-us/connectors/pdf4me/" target="_blank" rel="noopener noreferrer">the PDF4me Power Automate connector reference</a> for the full action list.

業界におけるユースケースとアプリケーション​

財務・会計におけるユースケース

  • トランザクションのクリーンアップ: 会計ログから古いまたは無効な取引行を削除します。
  • 期間終了月末締め処理後に一時的な計算行を削除する
  • レポート配信クライアントレポートから内部メモとレビューコメントを削除する
  • 予算テンプレート: 新しい予算テンプレートから前年度のサンプルデータを削除する

関連アクション​

他のプラットフォームでの同じタスク​

ヘルプが必要な場合​