Thread: Form toolbar
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Form toolbar

Dim drpdown as DropDown
for each drpdown in Activesheet.Dropdowns
drpdown.Select
msgbox drpdown.Name
next

These controls can have a macro assigned to them by right clicking on them
and from the popup menu select Assign Macro. This is then equivalent to a
click event macro.

Listboxes would be from the listboxes collection

Dim lbox as Listbox
for each lbox in Activesheet.ListBoxes

There are also collections for Spinners, Checkboxes, Optionbuttons, buttons
and Textboxes (from the drawing toolbar).

If you go into the VBE in the Object browser, right click on it and select
show hidden members.

You can then fine the dropdown and other forms objects and their properties
and methods.

If you want to send me an email with a good return address, I can send you a
file that has documentation on them. It is written for using them on dialog
sheets, but there isn't much difference between using them on dialog sheets
and using them on worksheets.

--
Regards,
Tom Ogilvy

"Johny" wrote in
message ...

Here is the case:

I have to adapt an old excel file. The person who made the file used
comboboxes from the FORM toolbar. How can I access these comboboxes
from within the code?

I read these objects doesn't fire events, so I gotta write a macro.
I wanna change the properties of a listbox when selecting a value in
another listbox. Deleting these objects and replacing them by ActiveX
objects isn't an option.

Somebody? :(


--
Johny
------------------------------------------------------------------------
Johny's Profile:

http://www.excelforum.com/member.php...o&userid=30859
View this thread: http://www.excelforum.com/showthread...hreadid=505268