LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default ComboBox Name array

I have a number of ComboBoxes on a Userform that all do the same
thing. I would like to be able to do all the init stuff in a For loop.
How can I refer to the ComboBoxes without specificing each name. The
following would be great but, of course it doesn't work. Any ideas?

ComboBoxArray = Array("ComboBox1", "ComboBox2", "ComboBox3",
"ComboBox4", "ComboBox5")

For i = 1 To NumComboBoxes
With HeaderUserForm.ComboBoxArray(i)
.Clear ' clear the listbox content
.ListIndex = 0 ' select the first item
' Do the other stuff
End With

Next i
 
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
Complex conditional summing - array COUNT works, array SUM gives#VALUE fatcatfan Excel Worksheet Functions 4 November 18th 09 06:41 PM
Prevent cell/array references from changing when altering/moving thecell/array nme Excel Discussion (Misc queries) 1 September 19th 08 01:53 PM
fill combobox depending on selection from another combobox Adam Francis Excel Discussion (Misc queries) 2 July 24th 08 07:39 PM
meaning of : IF(Switch; Average(array A, array B); array A) DXAT Excel Worksheet Functions 1 October 24th 06 06:11 PM
additem to combobox with an array jocke Excel Discussion (Misc queries) 2 September 29th 05 07:56 PM


All times are GMT +1. The time now is 05:34 PM.

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

About Us

"It's about Microsoft Excel"