<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<tabs>
<tab id="gsExpertExchange" label="Experts Exchange">
<group id="gsNavigateGroup" label="Navigation">
<menu id="gsNavigate" label="Navigate" size="large" image="navigate">
<button id="gsSheet1" label="Go to Sheet1" onAction="NavigateSheets" tag="0"/>
<button id="gsSheet2" label="Go to Sheet2" onAction="NavigateSheets" tag="1"/>
<button id="gsSheet3" label="Go to Sheet3" onAction="NavigateSheets" tag="2"/>
<menuSeparator id="gsNavSep1"/>
<button id="gsWhoAmI" label="Say who?" onAction="WhoAmI"/>
</menu>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
Option Explicit
Public Sub NavigateSheets(control As IRibbonControl)
Dim lTag As Long
lTag = CLng(control.Tag)
Application.ScreenUpdating = False
Select Case lTag
Case 0: wksSheet1.Activate
MsgBox ("This is Sheet1")
Case 1: wksSheet2.Activate
MsgBox ("This is Sheet2")
Case 2: wksSheet3.Activate
MsgBox ("This is Sheet3")
End Select
End Sub
Public Sub WhoAmI(control As IRibbonControl)
MsgBox ("Hello my name is Yuppidu")
End Sub
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<tabs>
<tab id="gsExpertExchange" label="Experts Exchange">
<group id="gsNavigateGroup" label="Navigation">
<menu id="gsNavigate" label="Navigate" size="large" image="navigate">
<button id="gsSheet1" label="Go to Sheet1" onAction="NavigateSheets" tag="0"/>
<button id="gsSheet2" label="Go to Sheet2" onAction="NavigateSheets" tag="1"/>
<button id="gsSheet3" label="Go to Sheet3" onAction="NavigateSheets" tag="2"/>
<menuSeparator id="gsNavSep1"/>
<button id="gsWhoAmI" label="Say who?" onAction="WhoAmI"/>
</menu>
</group>
<group id="gsHelpGroup" label="Help">
<menu id="gsHelp" label="Help" size="large" image="box">
<button id="gsHelpp" label="Help me" onAction="HelpInfo"/>
</menu>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (0)