Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Lee Lee is offline
external usenet poster
 
Posts: 33
Default Array question

In VB, when you copy a control or give two controls the
same name, VB asks if you want to create an array, and
creates the name with a subscript, such as Textbox(1),
Textbox(2), etc. It appears that VBA does not do this.
I'm not sure how to declare an array here.

I have five dropdown combo boxes that I want to each fill
with the same five values, and it seemed most efficient to
do this with an array.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Array question

VBA doesn't support control arrays.

for i = 1 to 5
userform1.Controls("Combobox" & i).List = Array(1,2,3,4,5)
Next

--
Regards,
Tom Ogilvy

"Lee" wrote in message
...
In VB, when you copy a control or give two controls the
same name, VB asks if you want to create an array, and
creates the name with a subscript, such as Textbox(1),
Textbox(2), etc. It appears that VBA does not do this.
I'm not sure how to declare an array here.

I have five dropdown combo boxes that I want to each fill
with the same five values, and it seemed most efficient to
do this with an array.



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
array question Mona Excel Discussion (Misc queries) 2 March 23rd 10 08:41 PM
another array question Robert Dieckmann Excel Worksheet Functions 5 January 20th 07 02:08 AM
Array Question keeblerjp Excel Discussion (Misc queries) 4 June 20th 06 04:21 PM
Array Question Renee Excel Worksheet Functions 0 June 29th 05 07:10 PM
vba array question chick-racer[_30_] Excel Programming 4 November 10th 03 05:59 PM


All times are GMT +1. The time now is 07:05 AM.

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"