View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
VBA Dabbler[_2_] VBA Dabbler[_2_] is offline
external usenet poster
 
Posts: 54
Default Userform Control Type

Great! Thanks for the suggestions, both work like a charm.

"keepITcool" wrote:

if you have vba6 (xl2000+)

dim ctl as object
for each ctl in me.controls
use TypeOf ctl IS msforms.Combobox etc.
intellisense will guide you... when you type in msforms.
but you can leave it out afterwards..
next

if you need to code for xl97 use
lcase(TypeName(ctl)) = "combobox" etc.

the names for the classes can be found in the
object browser in the msforms library.





--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


VBA Dabbler wrote :

I'm trying to step through a collection of controls on a userform
and, based on type, take certain steps.

Does anyone know the syntax for determining a userform control's
'type'? For example: is Control(i) a Textbox, Checkbox, Combobox,
etc.

Thanks,
VBA Dabbler