View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\) Rick Rothstein \(MVP - VB\) is offline
external usenet poster
 
Posts: 2,202
Default MyArray (ComboBox.ListCount-1) possible?

"How do I set the total number of elements of an array to match
the total number of items in a ComboBox


Give this a try (where I assumed the ComboBox was named ComboBox1)...

Dim X As Long
Dim MyArray() As String
ReDim MyArray(0 To ComboBox1.ListCount - 1)
For X = 0 To ComboBox1.ListCount - 1
MyArray(X) = ComboBox1.List(X)
Next

Rick