0
1

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.

【エクセル】固有オブジェクト

Last updated at Posted at 2021-02-25

Application

 全B00K中一つのみのオブジェクト

プロパティ一覧

DisplayAlerts

 DefaultはTrue, Falseにすることでシート削除時の「削除しますか?」といったダイアログを
 非表示にすることができる。(マクロでダイアログを操作する手間を省ける。)

ScreenUpdating

 DefaltはTrue、Falseにすることでマクロ実行中の画面更新を止める。(実行速度の向上)

StatusBar

文字列をBookの左下に表示することができる。

コード例

  Application.DisplayAlerts = False
  Application.ScreenUpdating = False
  
  Application.StatusBar = "処理開始"
  With ThisWorkbook
    .Worksheets.Add after:=.Worksheets(Worksheets.Count)
    Worksheets(Worksheets.Count).Delete
  End With
  Application.StatusBar = "処理完了"
  
  Application.DisplayAlerts = True
  Application.ScreenUpdating = True
  Application.StatusBar = ""

WorkSheetFunction

 SumやCountIfなど非VBA関数が使用できるようになる。

  With WorksheetFunction
    If .Sum(r.Offset(, 1).Resize(, 5)) >= 350 And _
       .CountIf(r.Offset(, 1).Resize(, 5), ">=50") = 5
0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?