Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Dynamically Assign Objects to Form Objects.

I have ten listboxes on a form, ddlwb1, ddlwb2 etc. I want to loop through
them and dynamically assign them to an object like so:

For i = 1 To 10
Set objDdl = ddlwb & i
'do something else with objDdl
Next

Obviously this doesn't work, but I vaguely recall a command that will make
it work, though for the life of me I can't remember what.

Thanks,
Wayne C.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Dynamically Assign Objects to Form Objects.

For i = 1 To 10
Set objDdl = Userform1.Controls("ddlwb" & i)
'do something else with objDdl
Next

--
Regards,
Tom Ogilvy

"The Vision Thing" wrote in message
...
I have ten listboxes on a form, ddlwb1, ddlwb2 etc. I want to loop

through
them and dynamically assign them to an object like so:

For i = 1 To 10
Set objDdl = ddlwb & i
'do something else with objDdl
Next

Obviously this doesn't work, but I vaguely recall a command that will make
it work, though for the life of me I can't remember what.

Thanks,
Wayne C.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Dynamically Assign Objects to Form Objects.

Thank you Tom, worked like a charm.

Wayne C.




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
Unable to remove Sheet objects in the Microsoft Excel Objects Adrian[_7_] Excel Programming 1 August 26th 04 10:49 PM
loop through form objects Steven K Excel Programming 1 August 23rd 04 07:47 PM
Moving objects on a form Steven K Excel Programming 1 August 23rd 04 06:13 PM
Assign macros to dynamically created form elements Joepy Excel Programming 4 March 3rd 04 09:03 PM
Can't insert form objects Mat Excel Programming 2 November 9th 03 01:50 AM


All times are GMT +1. The time now is 11:00 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"