<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon>
<tabs>
<tab id="IDARAC" label="Idarac Functions">
<group id="spFunctions" label="Special Functions">
<button id="XXXX"
label="XXXX Tool"
size = "large"
onAction="IDARAC_Handler"
screentip="Run the XXXX Tool"
supertip="This button will execute the Special Functions XXXX Tool"
imageMso="CalendarToolSelectDate" />
<button id="YYYY"
label="YYYY Tool"
size = "large"
onAction="IDARAC_Handler"
screentip="Run the YYYY Tool"
supertip="This button will execute the Special Functions YYYY Tool"
imageMso="Pushpin" />
<button id="ZZZZ"
label="ZZZZ Tool"
size = "large"
onAction="IDARAC_Handler"
screentip="Run the ZZZZ Tool"
supertip="This button will execute the Special Functions ZZZZ Tool"
imageMso="CheckWorkflow" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
The VBA code associated with the new ribbon buttons is:
Option Explicit
'---------------------------------------------------------------------------------------
' Procedure : IDARAC_Handler
' Author : Jerry Paladino on EE
' Question : Q_28460080
' Date : 06/21/2014
' Purpose : Main Routine RibbonX Handler to call specific routines
'---------------------------------------------------------------------------------------
'
Sub IDARAC_Handler(control As IRibbonControl)
Select Case UCase(control.ID) ' which button in the ribbon the user clicked
Case "XXXX" ' user clicked the XXXX Button
Call myMacro_XXXX
Case "YYYY" ' user clicked the YYYY Button
Call myMacro_YYYY
Case "ZZZZ" ' user clicked the ZZZZ Button
Call myMacro_ZZZZ
Case Else
MsgBox "Unknown or Under Construction"
End Select
End Sub
'---------------------------------------------------------------------------------------
' Procedure : myMacro_XXXX
' Author : Jerry Paladino on EE
' Question : Q_28460080
' Date : 06/21/2014
' Purpose : Stub for future macro
'---------------------------------------------------------------------------------------
'
Sub myMacro_XXXX()
'Enter future macro code here
MsgBox "Hello World - My name is myMacro_XXXX"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : myMacro_YYYY
' Author : Jerry Paladino on EE
' Question : Q_28460080
' Date : 06/21/2014
' Purpose : Stub for future macro
'---------------------------------------------------------------------------------------
'
Sub myMacro_YYYY()
'Enter future macro code here
MsgBox "Hello World - My name is myMacro_YYYY"
End Sub
'---------------------------------------------------------------------------------------
' Procedure : myMacro_ZZZZ
' Author : ProdOps on EE
' Question : Q_28460080
' Date : 06/21/2014
' Purpose : Stub for future macro
'---------------------------------------------------------------------------------------
'
Sub myMacro_ZZZZ()
'Enter future macro code here
MsgBox "Hello World - My name is myMacro_ZZZZ"
End Sub
I have provided this solution in another EE question located at:EE-28460080
I suspect that you will need to put the ribbon into an XL addin and use ribbon invalidate to destroy and rebuild the ribbon based on application events - sheet / window / workbook _Change