どのコマンドバーボタンをVBAを使用してマクロを起動するかを決定する方法?
3553 ワード
この記事では、どのコマンドバーボタンがマイクロソフトExcelでVBA * *を使用してマクロを起動するかを決定する方法を学びます.下で見ましょう!次のリンクからMS Excelの公式バージョンを取得します.https://www.microsoft.com/en-in/microsoft-365/excel
例 まず、Excelのワークシートでは、[開発]タブに移動する必要があります.
次に、コードセクションの下のVisual Basicオプションを選択する必要があります. 選択します さて、以下のコードをコピーしてペーストしなければなりません.
選択してコードを保存し、ウィンドウを閉じる必要があります. コードを保存する 再度、Excelのスプレッドシートに移動し、[開発]タブをクリックします. 次に、コードセクションでマクロオプションを選択する必要があります. マクロオプションの選択 ここで、マクロ名が選択されていることを確認し、* Run *ボタンをクリックします. コードを実行する 最後にマクロを実行した後、Excelで以下のように*出力*を取得します. 出力
包む
この記事では、どのコマンドバーボタンをマイクロソフトExcelでVBAを使用してマクロを起動するかを決定する方法についてのガイドラインを示します任意のクエリの場合にコメントを残して、同様にあなたの貴重な提案を言及することを忘れないでください.私たちのサイトを訪問していただきありがとうございます!学習を続けるGeek Excel !! *続きを読むExcel Formulas *!!
関連記事 Excel Formulas to Find Pass or Fail Using COUNTIF Function!! Insert Multiple Option Buttons at Once in Excel Office 365!! Batch Delete Option Buttons with One Click in Excel Office 365!! How to use DATE Function in Microsoft Excel 365?
例
Sub DummyMacro()
If Application.CommandBars.ActionControl Is Nothing Then
' the macro was not started from a commandbar button
MsgBox "This could be your macro running!", vbInformation, _
"This macro was not started from a CommandBar button"
Else ' the macro was started from a commandbar button
MsgBox "This could be your macro running!", vbInformation, _
"This macro was started from this CommandBar button: " & _
Application.CommandBars.ActionControl.Caption
End If
End Sub
包む
この記事では、どのコマンドバーボタンをマイクロソフトExcelでVBAを使用してマクロを起動するかを決定する方法についてのガイドラインを示します任意のクエリの場合にコメントを残して、同様にあなたの貴重な提案を言及することを忘れないでください.私たちのサイトを訪問していただきありがとうございます!学習を続けるGeek Excel !! *続きを読むExcel Formulas *!!
関連記事
Reference
この問題について(どのコマンドバーボタンをVBAを使用してマクロを起動するかを決定する方法?), 我々は、より多くの情報をここで見つけました https://dev.to/excelgeek/how-to-determine-which-commandbar-button-started-a-macro-using-vba-4i8lテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol