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 Looping through multiple controls

Even though they are on pages of a multipage, I believe you can reference
them directly from the userform

Dim lbox as MSForms.Listbox
for i = 1 to 4
set lbox = Userform1.Controls("LB" & i)
lbox.listindex = -1
Next

--
Regards,
Tom Ogilvy

"rci" wrote in message
...
Hi all...

I have a multipage object, with a list box on each page.

I would like to loop through all of the listbox objects in a for next
loop... checking/setting properties.

How can I do this? They don't have an index property... but I have named
them LB1, LB2, LB3...

Ideas?

Thanks,

Mike