What is the standard practice for adding range selection controls to a ribbon bar in Excel? I’m creating an Add-In and need to enable the user to define a series of ranges. Here’s a link to a question with an illustration of what I want Provide a range selection tool/utility to the user in Excel VBA. The answer to the question however only works in the context of a winform. My research suggests you can’t use RefEdit controls directly in a ribbon bar. Is that true? If so, what solution do you recommend? I considered creating a button that triggers a popup containing a RefEdit control, but that strikes me as a poor user experience since it involves additional clicks by the user.
What is the standard practice for adding range selection controls to a ribbon bar
Share
Unfortunately, you are correct: the RefEdit control cannot be used within a ribbon. However, you can use a button control to populate an editBox control with the currently selected range, using the editBox’s
getTextdynamic attribute. This will not only place a control within the ribbon that displays the selected range and holds the value there with a single click, but — if needed — other automated processes can be executed as well.