X(Twitter) Zenn GitHub RSS 共有

現場に入ったらやる事

作成日時:2024-08-01以前
更新日時:2024-08-01

議事録

設定色々

PCのパフォーマンス編(Windows)

VBA

全シートをA1に揃えるアドイン

sub main()
  Dim wb As Workbook
  Set wb = ActiveWorkbook

  Dim ws as Worksheet
  For Each ws In wb.Worksheets
    ws.Activate
    ActiveWindow.SmallScroll Down:=-500
    ws.Cells(1, 1).Select
  Next

  wb.Worksheets(1).Activate

画面活性制御

Sub Main()
    On Error GoTo FINALLY_SECTION
    Call SetScreenUpdating(False)
    'ここに処理を書く

FINALLY_SECTION:
    Call SetScreenUpdating(True)
    MsgBox "END:" & Err.Description
END Sub

Sub SetScreenUpdating(ByVal flg As Boolean)
    Application.ScreenUpdating = flg
    Application.DisplayAlerts = flg
End Sub