![]() ![]() You have to find it in the Worksheet.ListBoxes collection, which contains a reference to every listBox in your sheet. In VBA, it's a bit of a challenge finding your listBox. If you don't mind a little techno-babble, one example is that the collection which contains ListBoxes is hidden, not in the Object Model, but without it, you're forced to use the read-only Shapes collection, for which the only way to change the list contents is to associate the list with a range (only useful in very specific cases) or to use the AddItem and RemoveItem functions, which are limited. The ListBox control is a good example of one where you might prefer the Forms control over the ActiveX equivalent, but there are all sorts of snags when dealing with it. Instead of inserting an ActiveX control, you can insert a corresponding Forms control, which is much more refined, and much prettier, but is hardly customizable. When creating controls in Excel, ActiveX controls are so much easier to programmatically manipulate and format, but damn are they ugly, and they behave in such unexpected ways. Why use a Form Control over an ActiveX control? If you've ever played around with these, you'd know theres a pretty big difference in what you can and can't do with each. When you go to add a control from the developer tab (Insert button) or control toolbar, you see Form Controls on top and ActiveX controls on bottom. In excel 2003, just view the controls toolbar. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab in the Ribbon" (Check it). The forms List Box is the alternative to the ActiveX list box. What is a Form List Box? (skip if you know this) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |