Home » excel » excel – Ribbon – How to set an ID for each combobox item?

excel – Ribbon – How to set an ID for each combobox item?

Posted by: admin April 23, 2020 Leave a comment

Questions:

How can I set an ID to each combobox item in an Excel Ribbon?

The follow code is where I set a text (label) to each item, I’d like to set an ID to each item, in order to identify it later. How can I do this?

Private Sub cbIndentItem(control As IRibbonControl, index As Integer, ByRef Label)
    Label = taskLvl(index).NameLvl
End Sub
How to&Answers:

Usually names for combobox objects are set in VBA editor, using the properties pane. But, to identify it later, you would identify it either by the name you assign to it or by an index value.