# Excelの中身の検索

**URL:** <https://forum.uipath.com/t/excel/392902>\
**Category:** Studio\
**Tags:** workflow-diff, question, studio, excel, activities\
**Created:** [January 21, 2022, 6:24am UTC](https://forum.uipath.com/t/excel/392902 "2022-01-21T06:24:46Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![marita](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/marita/32/176617_2.png) [@marita](https://forum.uipath.com/u/marita)\
**Post date:** [January 21, 2022, 6:24am UTC](https://forum.uipath.com/t/excel/392902/1 "2022-01-21T06:24:46Z")

</div>

お世話になっております。

ExcelのファイルAのA列の番号を上から順番にファイルBのA列から検索して、ファイルAのN列の日付とファイルBのB列の日付が違っているものを抽出したいのですが、どのようにすればよいでしょうか？  
サンプルのExcelファイルを添付しています。  
よろしくお願いいたします。

[サンプル.zip](https://forum.uipath.com/uploads/short-url/wxCx2uFQ3FpTYa2APl5XO1ayI2o.zip) (30.6 KB)

---

<div class="post-metadata">

**Author:** ![Yoichi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yoichi/32/523754_2.png) [@Yoichi](https://forum.uipath.com/u/Yoichi)\
**Post date:** [January 21, 2022, 7:02am UTC](https://forum.uipath.com/t/excel/392902/2 "2022-01-21T07:02:23Z")

</div>

こんにちは

今回のサンプルに上記に該当するレコードはありますか？可能なら期待する結果も添付いただくと良いかもしれません。

---

<div class="post-metadata">

**Author:** ![marita](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/marita/32/176617_2.png) [@marita](https://forum.uipath.com/u/marita)\
**Post date:** [January 21, 2022, 7:14am UTC](https://forum.uipath.com/t/excel/392902/3 "2022-01-21T07:14:51Z")

</div>

お世話になっております。  
添付していたファイルには期待する結果がなかったので、サンプルを作ってみました。  
黄色く塗りつぶしているところが追加した部分でファイルAとBのA列の番号は同じですが、B列とN列の日付が違っています。  
違っていた時に、ファイルAの日付が塗りつぶされるか、横の列に✖の表示が出るようにして、違っている部分が分かるようにしたいです。

[サンプル.zip](https://forum.uipath.com/uploads/short-url/fd7IPLEoROGA7UWQBrVAQ7xBkf7.zip) (30.8 KB)

よろしくお願いいたします。

---

<div class="post-metadata">

**Author:** ![Yoichi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yoichi/32/523754_2.png) [@Yoichi](https://forum.uipath.com/u/Yoichi)\
**Post date:** [January 21, 2022, 7:28am UTC](https://forum.uipath.com/t/excel/392902/4 "2022-01-21T07:28:38Z")

</div>

こんにちは

アプローチとしては、Joinしてフィルターすれば、該当行を抽出できると思います。  
サンプルAの方は列名の重複があるので、これを手修正したものが以下のサンプルになります。

 ![img20220121-9](https://global.discourse-cdn.com/uipath/original/4X/4/5/1/451aac7a21b7bbf09c50cf61febbde93a240307d.png)

[Sample20220121-5.zip](https://forum.uipath.com/uploads/short-url/jsyuL8qtQXA4vvRRncDpDG3ZOH5.zip) (34.5 KB)

あとは抽出したレコードから、当該行に印をつける等を行えばよいかと思います。

---

<div class="post-metadata">

**Author:** ![marita](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/marita/32/176617_2.png) [@marita](https://forum.uipath.com/u/marita)\
**Post date:** [January 21, 2022, 8:22am UTC](https://forum.uipath.com/t/excel/392902/5 "2022-01-21T08:22:29Z")

</div>

確認させていただきたいのですが、このサンプルでできているのは日付が違うものを抽出するところまでですか？  
最後のWriteRangeは印をつける作業の部分ですか？

---

<div class="post-metadata">

**Author:** ![Yoichi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yoichi/32/523754_2.png) [@Yoichi](https://forum.uipath.com/u/Yoichi)\
**Post date:** [January 21, 2022, 8:26am UTC](https://forum.uipath.com/t/excel/392902/6 "2022-01-21T08:26:21Z")

</div>

こんにちは

> [@marita](#):
>
> このサンプルでできているのは日付が違うものを抽出するところまでですか？

はい、そうです。この情報をもとに必要な行に印をつけてもらえればと思います。

---

<div class="post-metadata">

**Author:** ![marita](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/marita/32/176617_2.png) [@marita](https://forum.uipath.com/u/marita)\
**Post date:** [January 21, 2022, 8:31am UTC](https://forum.uipath.com/t/excel/392902/7 "2022-01-21T08:31:49Z")

</div>

分からないことが多くてすみません。  
必要な行に印をつける作業はWriteRangeの下に続きますよね？  
印をつけるにはどのアクティビティが最適か想像がつきません。  
どんな方法があるか教えていただけませんか？  
よろしくお願いいたします。

---

<div class="post-metadata">

**Author:** ![Yoichi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yoichi/32/523754_2.png) [@Yoichi](https://forum.uipath.com/u/Yoichi)\
**Post date:** [January 21, 2022, 8:45am UTC](https://forum.uipath.com/t/excel/392902/8 "2022-01-21T08:45:25Z")

</div>

こんにちは

> [@marita](#):
>
> 必要な行に印をつける作業はWriteRangeの下に続きますよね？

このWriteRangeは結果の確認のために出力しているだけですので、本来印をつけたいであろう  
サンプルAとは異なりますから、最終目的から考えると不要です。

そのためサンプルA(dtA)の方に印をつける列を拡張して、各行の受注番号が、上記で抽出したものと一致するか確認→一致すればｘを入れる、ような処理が必要かと思います。

[Sample20220121-5v2.zip](https://forum.uipath.com/uploads/short-url/nVbwL0T21jXyMh79AGVo6FX8P8Z.zip) (35.0 KB)

---

<div class="post-metadata">

**Author:** ![marita](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/marita/32/176617_2.png) [@marita](https://forum.uipath.com/u/marita)\
**Post date:** [January 22, 2022, 1:04am UTC](https://forum.uipath.com/t/excel/392902/9 "2022-01-22T01:04:35Z")

</div>

お世話になっております。  
今回いただいたサンプルは×を書き込む処理は入っていないですよね？  
自分で書き込む処理を追加してみたのですが、抽出した全てのデータとそれに✖がついたものが書き込まれてしまいました。  
間違っているところだけを上手く抽出できていないのでしょうか？  
それとも書き込む方法が間違っているのでしょうか？

---

<div class="post-metadata">

**Author:** ![Yoichi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yoichi/32/523754_2.png) [@Yoichi](https://forum.uipath.com/u/Yoichi)\
**Post date:** [January 22, 2022, 5:31am UTC](https://forum.uipath.com/t/excel/392902/10 "2022-01-22T05:31:07Z")

</div>

こんにちは

> [@marita](#):
>
> 今回いただいたサンプルは×を書き込む処理は入っていないですよね？

result.xlsxとしてxがついたものを書き出していると思いますが、ついていませんでしょうか？

---

<div class="post-metadata">

**Author:** ![marita](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/marita/32/176617_2.png) [@marita](https://forum.uipath.com/u/marita)\
**Post date:** [January 24, 2022, 7:16am UTC](https://forum.uipath.com/t/excel/392902/11 "2022-01-24T07:16:52Z")

</div>

お世話になっております。

確認不足ですみません。  
×がついていました。  
ただ、全て×がついてしまっているのですが何か理由があるのでしょうか？

---

<div class="post-metadata">

**Author:** ![Yoichi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yoichi/32/523754_2.png) [@Yoichi](https://forum.uipath.com/u/Yoichi)\
**Post date:** [January 24, 2022, 7:19am UTC](https://forum.uipath.com/t/excel/392902/12 "2022-01-24T07:19:25Z")

</div>

こんにちは

上記添付したサンプルは結果にはｘは一行しかつかないと思いますが…。  
入力データは別のデータになりますでしょうか？

---

<div class="post-metadata">

**Author:** ![marita](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/marita/32/176617_2.png) [@marita](https://forum.uipath.com/u/marita)\
**Post date:** [January 24, 2022, 7:38am UTC](https://forum.uipath.com/t/excel/392902/13 "2022-01-24T07:38:08Z")

</div>

2回目に作成していただいたサンプルのZipファイルの中身をコピーして全く同じものを使っています。

---

<div class="post-metadata">

**Author:** ![Yoichi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yoichi/32/523754_2.png) [@Yoichi](https://forum.uipath.com/u/Yoichi)\
**Post date:** [January 24, 2022, 9:02am UTC](https://forum.uipath.com/t/excel/392902/14 "2022-01-24T09:02:42Z")

</div>

こんにちは

上記添付したものですが、実行結果は下記の通りxが一つだけです。

 ![img20220124-7](https://global.discourse-cdn.com/uipath/original/4X/7/4/1/7414f323547cfc94df530bd69a073c13d94a97b3.png)

解凍したものをそのまま開いて実行してもらえますでしょうか？  
もしこれがＯＫでしたら、コピーした際に何らかの状況変化があったと考えられます。

---

<div class="post-metadata">

**Author:** ![marita](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/marita/32/176617_2.png) [@marita](https://forum.uipath.com/u/marita)\
**Post date:** [January 24, 2022, 11:42pm UTC](https://forum.uipath.com/t/excel/392902/15 "2022-01-24T23:42:19Z")

</div>

お世話になっております。  
解答したものをそのまま開いて実行したところOKでした。  
うまくいかない原因をさぐってみます。  
ありがとうございました。

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [January 27, 2022, 11:43pm UTC](https://forum.uipath.com/t/excel/392902/16 "2022-01-27T23:43:09Z")

</div>

Closed on January 27, 2022, 11:43pm UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
