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.

全シート検索して集計シートに集まる

Posted at

大量のメールの中で重要なメールをエクセルの
シートに貼りつけて保存して、キーワードで
関連情報を抜き出す時に使ってました。

あるDir下の全ワード、エクセル、他ファイル
を全てオープンして、キーワードにヒットした
前後10行を一覧表示するのを作ってましたが
やり方忘れてしまいました(^^;;

vbaで試してないので、本当に適当なメモ書き
です、あとで一度整理して完成品をあげたいです

option explicit

dim sh as worksheet
dim i , j as long
dim keycode as string

keycode = "hoge"

for each sh in worksheets
if sh.name <> "集計" then

 for i = 1 to 100
     for j = 1 to 100
        if instr(sh.range(i,j).value,keycode )  <> 0 then

           worksheets("集計").range(current,5) = sh.range(i,j).value

同上で、.font.size = 14
同上で、.interior.color= rgb(255,0,0)
.colorindex = 20

前後5行を設定する

      current += 10
     next j
  next i

endif
next

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?