Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
rci rci is offline
external usenet poster
 
Posts: 40
Default Looping through multiple controls

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Looping through multiple controls

For x = 1 To Worksheets.Count
Worksheets(x).ListBox(1)
Next x

- Piku

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot select multiple controls Blue Max New Users to Excel 3 March 14th 10 07:28 AM
LOOPING multiple ranges Jase Excel Discussion (Misc queries) 1 April 7th 08 06:21 PM
Macro bug - looping thru multiple worksheets - workaround? Bruce Erlichman Excel Programming 3 January 26th 04 09:03 PM
looping to create multiple files jrh Excel Programming 1 July 23rd 03 07:09 PM
Looping thru custom controls papou[_6_] Excel Programming 2 July 23rd 03 04:14 PM


All times are GMT +1. The time now is 04:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"