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 3 years have passed since last update.

備忘録 - ループ処理 【VBA】

Posted at

For Each構文の文法

For Each エレメント In グループ ' エレメントは繰り返す変数・グループはコレクション(配列)
'処理は中に記述
Next エレメント

具体例

VBAが書かれているワークブック内のワークシートをすべて保護する

    Dim Sh As Worksheet

    For Each Sh In ThisWorkbook.Worksheets
        Sh.Protect
    Next Sh
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?