Skip to content

Instantly share code, notes, and snippets.

@nobrinskii
Created March 16, 2012 05:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nobrinskii/2048637 to your computer and use it in GitHub Desktop.
Save nobrinskii/2048637 to your computer and use it in GitHub Desktop.
[vba/excel] エクセルの動作一括制御
'##############################################################################
'エクセルの動作一括制御
'##############################################################################
'------------------------------------------------------------------------------
'エクセルの自動機能停止
'------------------------------------------------------------------------------
'【引数】
'【戻り値】
'【備考】
Private Sub FreezeExcel()
With Application
.Visible = False '全体の表示を停止
.DisplayAlerts = False 'アラートの表示を停止
.StatusBar = False 'ステータスバーの表示更新を停止
.ScreenUpdating = False 'スクリーンの描画を停止
.EnableEvents = False 'イベントを一時停止
.Calculation = xlManual '計算を手動モードにする
End With
End Sub
'------------------------------------------------------------------------------
'エクセルの自動機能再開
'------------------------------------------------------------------------------
'【引数】
'【戻り値】
'【備考】
Private Sub MeltExcel()
With Application
.Calculation = xlAutomatic '計算を自動モードに戻す
.EnableEvents = True 'イベントを再開
.ScreenUpdating = True 'スクリーンの描画を再開
.StatusBar = True 'ステータスバーの表示を再開
.DisplayAlerts = True 'アラートの表示を再開
.Visible = True '全体の表示を回復
End With
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment