I'm sure you are not an idiot; just a newbee to VBA.
O.K. there are 2 types of controls. One type is the Forms Controls and the
other is ActiveX controls. Both are almost identical in their purpose but
they operate differently. ActiveX controls are the later technology and I
think that the Forms controls are only there to keep xl backward compatible.
I think that ActiveX controls started with xl2000 but I’ll stand correcting
on that but they have certainly been around since xl2002.
In xl 2007 you will see both types in the drop down when you click on Insert
Controls.
In earlier versions of xl, to see the Forms controls, you need the Forms
tool bar visible. To see the ActiveX controls you need the Control Toolbox
tool bar visible.
I just tested your code and it appears that you have created your List Box
from the Forms tool bar and of course the code is for ActiveX controls and
does not work on on Forms Controls. There are a number of advantages to using
the ActiveX controls so rather than alter the code to work with Forms
controls I’ll try to explain how to create an ActiveX control and set its’
properties.
Click on the List box icon and then on the worksheet and drag the list box
out to the required size. (Same as for the Forms controls). Note the icon on
the toolbar that looks like a blue set square, pencil and ruler. It is called
Design Mode. It automatically turns on when you create the list box but more
on Design Mode later.
Right click on the list box after you have set its’ size (Note Design Mode
needs to be on) and then select Properties. The top of the list is the list
box name which is user changeable. It is this name which you use to refer to
the control throughout your VBA code. Check out the other properties
including Multi select.
Before you can use the list box, turn off Design Mode. (Click on the icon.).
Now at any time you want to make changes to the properties, you need to turn
design mode on.
Now turn design mode on and this time when you right click, select View
Code. The VBA editor will open and place a private sub name and end sub. Note
in the Project explorer that the code is attached to the Sheet name on which
the list box has been inserted. Code that you want to run when the user
selects a value in the list box is inserted here. However, it does not
operate with multi list boxes because it would not know when the user has
finished selecting. The code you have for multi select can be in a Module.
Try the above and get back to me if you have any further questions.
Also what version of xl you are using? (It is a good idea to always include
it on requests to this forum.)
Regards,
OssieMac