22 VBA Advanced (Adding Customized Menu and Add Ins)
22 VBA Advanced
Follow-up of VBA Beyond Basics and VBA for EveryOne Series
Topics in this Video:
Adding Customized Menu to Excel Ribbon
Creating Add-Ins
My Blog: https://letsxcel.blogspot.com/
Code:
Sub vMenuCeator()
Dim vNewMenu As CommandBarPopup
Dim vSubMenu As Object
Dim vMenuItem As CommandBarButton
'Add Menu & Name it
Set vNewMenu = Application.CommandBars(1). _
Controls.Add(Type:=msoControlPopup, Temporary:=True)
vNewMenu.Caption = "New Menu"
'Add Sub Menu
Set vSubMenu = vNewMenu.Controls.Add _
(Type:=msoControlPopup)
vSubMenu.Caption = "My Commands 1"
'Menu Item 1
Set vMenuItem = vSubMenu.Controls.Add _
(Type:=msoControlButton)
vMenuItem.OnAction = "vHelloWorld"
vMenuItem.Caption = "Run Pop-Up Macro"
vMenuItem.FaceId = 230
'Menu Item 2
Set vMenuItem = vSubMenu.Controls.Add _
(Type:=msoControlButton)
vMenuItem.OnAction = "vHelloWorld"
vMenuItem.Caption = "Button 2"
vMenuItem.FaceId = 23
End Sub
Sub vHelloWorld()
MsgBox ("Hello World")
End Sub
Sub vDeleteMenu()
Application.CommandBars(1).Controls _
("New Menu").Delete
End Sub
Видео 22 VBA Advanced (Adding Customized Menu and Add Ins) канала 545sytes
Follow-up of VBA Beyond Basics and VBA for EveryOne Series
Topics in this Video:
Adding Customized Menu to Excel Ribbon
Creating Add-Ins
My Blog: https://letsxcel.blogspot.com/
Code:
Sub vMenuCeator()
Dim vNewMenu As CommandBarPopup
Dim vSubMenu As Object
Dim vMenuItem As CommandBarButton
'Add Menu & Name it
Set vNewMenu = Application.CommandBars(1). _
Controls.Add(Type:=msoControlPopup, Temporary:=True)
vNewMenu.Caption = "New Menu"
'Add Sub Menu
Set vSubMenu = vNewMenu.Controls.Add _
(Type:=msoControlPopup)
vSubMenu.Caption = "My Commands 1"
'Menu Item 1
Set vMenuItem = vSubMenu.Controls.Add _
(Type:=msoControlButton)
vMenuItem.OnAction = "vHelloWorld"
vMenuItem.Caption = "Run Pop-Up Macro"
vMenuItem.FaceId = 230
'Menu Item 2
Set vMenuItem = vSubMenu.Controls.Add _
(Type:=msoControlButton)
vMenuItem.OnAction = "vHelloWorld"
vMenuItem.Caption = "Button 2"
vMenuItem.FaceId = 23
End Sub
Sub vHelloWorld()
MsgBox ("Hello World")
End Sub
Sub vDeleteMenu()
Application.CommandBars(1).Controls _
("New Menu").Delete
End Sub
Видео 22 VBA Advanced (Adding Customized Menu and Add Ins) канала 545sytes
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
13 VBA Advanced Sending Email Second Method4 (XL-DB) Macro Post New Entry to Table6 Solar IoT Demo Hardware and Connections20 VBA Advanced Misc Commands23) Excel - COUNTIF FunctionChange Youtube substitles/captions into your language12. RAM (Building Value PC)12) Excel - CLEAN Function12 VBA Advanced Sending Email One Sheet Simplest20) Excel - COUNT Function9 (Ard to Invt) 14 Line Arduino Code3 (XL-DB) Simple Manual Database2. Home/Floor Plan in Excel - Very SimpleO Who Believe3 VBA Advanced Introduction to Events and Active X ControlsESP32 NOW (1) (Minimal Code , One to One) Wireless Data Share without wifi router7 Demo - User Guide (Part 1) - SIT Demo7 (XL-DB) Creating Audit Trail21 VBA Advanced For Each Step2) Basics/Syntax of Excel Functions19. M4000M in Dell m6800 (No Voice)