いつも忘れてしまうのでメモ。
右クリックメニューの階層化。高速化等々。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
Dim caption As String Sub auto_open() On Error Resume Next caption = "会員検索フォーム" For i = 1 To 3 Application.CommandBars("cell").Controls(caption).Delete Next With Application.CommandBars("cell").Controls.Add .OnAction = "show_form" .caption = caption End With Call show_form 'With Application.CommandBars("cell").Controls.Add(Type:=msoControlPopup) ' .caption = "メニュー" ' With .Controls.Add(Type:=msoControlButton) ' .caption = "アイテム" ' .OnAction = "show_form" ' End With 'End With End Sub Sub auto_close() On Error Resume Next For i = 1 To 3 Application.CommandBars("cell").Controls(caption).Delete Next ' Application.CommandBars("cell").Controls("メニュー").Delete End Sub Sub Initialize() Application.ScreenUpdating = False Application.EnableEvents = False Application.DisplayAlerts = False Application.Calculation = xlCalculationManual ' 関数利用注意 End Sub Sub Finalize() Application.Calculation = xlCalculationAutomatic Application.DisplayAlerts = True Application.EnableEvents = True Application.ScreenUpdating = True End Sub |