0
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?

More than 1 year has passed since last update.

Bizrobo!_Excelのセル値を検索し、値を設定する(名前付き範囲設定)

Posted at

処理概要

ExcelのSheet1にある店舗ごとの売り上げを
image.png

Sheet2の集計表に集計する
image.png

集計結果
image.png

事前準備

変数の作成
image.png
それぞれの型

変数名
数量 Integer
店舗 ShortText
商品 ShortText
excel Excel

ロボットの全体図

image.png

ステップ

・Load FileステップとOpen Excelステップで「集計.xlsx」を開きます
・1つ目のSet Named RangeステップでアプリケーションウィンドウでSheet2の集計表を表示させます。
 店舗(B4~B6)を選択した状態で右クリック>その他>名前付き範囲設定を選択します
image.png
 名前付き範囲設定ステップで範囲名に名前を付けます
image.png
 名前付き範囲設定ステップを通過すると店舗に範囲名が表示されます
image.png
・2つ目のSet Named Rangeステップも同様です
image.png
image.png
image.png
・Loop RowsステップでSheet1をループ
・Extractステップで店舗、商品、数量を取得します
image.png
・Set Content of Cellステップで集計表に値を設定します
 エンドステップまでロボットを動かします
image.png
 アプリケーションウィンドウで右クリックし、コンテンツ設定をクリックします
image.png
 コンテンツは変数の数量を選択します
image.png
 作成されたSet Content of Cellステップのファインダーを設定します
image.png
 範囲から!以降のセルを削除します
image.png
 使用を範囲全体→指定位置のセル
 列をインデックスで指定→ヘッダーで指定、ヘッダー範囲:商品、ヘッダーパターン:商品
 行をインデックスで指定→ヘッダーで指定、ヘッダー範囲:店舗名、ヘッダーパターン:店舗
 と設定します
 ヘッダー範囲はLoop Rowsステップ前に作成したSet Named Rangeステップの範囲名、
 ヘッダーパターンはLoop Rowsステップ内で作成したExtractで取得した商品、店舗の変数になります
image.png
・エンドステップまでロボットを動かします
image.png
 店舗名と商品に該当するセルに値を設定できました

・集計表にない商品の場合
 Loop RowsでSheet1の商品、タブレットを取得しました。
image.png

 集計表にはタブレットが存在しません
image.png

 そのためSet Content of Cellステップがエラーになりました
image.png

 集計表にない商品、店舗名でもSheet1の次の行の処理を行う必要があるため、
 Set Content of Cellステップのエラー処理を「次のイテレーション」に変更します
 これで集計表にない商品、店舗名の場合でもロボットが停止せず処理を行えます
image.png

0
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
0
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?