Multi-column Dropdown combox on a commandbar

C

Chris Wilkinson

mhi,

is it possible to have a dropdown combox on a toolbar that has more than one
column of data? I have tried using the following syntax:
dim ctl as commandbarcombobox

set ctl = Commandbars("test").controls.add(Type:=msoControlDropdown)
ctl.additem "1;first item"
ctl.additem "2;second item"
or
ctl.additem "1,first item"
ctl.additem "2,second item"
but both only give a single column. How would I create a 2 column dropdown
comobobox on a toolbar, then populate it?

thanks in advance,
Chris
 
K

Kent Prokopy

Not sure that this can be done. But I guess my question to you is why would
you need more then one column showing off the menu bar? You can only select
one item to execute.
 
C

Chris Wilkinson

hi Kent,

it is for formatting purposes. the dropdown contains a list of codes, each
with a corresponding piece of text. When a particular row of the dropdown is
selected, the code is put into one cell and the corresponding text into the
adjacent cell. If it is all information is in one column of the dropdown, it
looks messy, e.g:
A1 Sample collection
A12 Next Sample
B1 Newer sample.
I would like the start of each piece of text to line up neatly. Using VBtab
does not work either.
 
K

Kent Prokopy

Well, The only thing I can think of is to create a menu item that opens a
userform and put a combobox on it. This way you can have your multi columns.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top