Custom Ribbon

ccordner

Active Member
Joined
Apr 28, 2010
Messages
355
Hi

Is it possible to have a callback for the ribbon when a key is pressed, rather than when they press 'tab' or 'enter' - for a dynamic search?

Also, is it possible within VBA to set focus on a Ribbon Control? E.g. after the macro has executed, to go back to the text box in the ribbon?

Thanks
Chris
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hi

Check if the custom control has a shortcut key combination. Press ALT to display the tab shortcuts, and then press the key corresponding to the tab where the control is.
If it has a shortcut, it will be displayed.
 
Upvote 0
The code below sets focus to a custom edit box in the ribbon. Sending keys is not completely reliable, but very easy to implement.


Code:
Sub Edit_Box()
With Application
    .SendKeys "%c"              ' ALT + C to activate the tab
    .Wait Now + #12:00:01 AM#
    .SendKeys "y3"              ' Y3 for the custom edit box
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,755
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top