Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 471
Default ComboList Source

I want to set the rowSource Property (The list of the combo box that pops up
when you click the pulldown) to an array that is already built. I try to
type the name of the array in the box but it doesn't allow that. What am I
missing here?
Also, how would the array be set up so that the titles of the columns of
data have a heading?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default ComboList Source

This doesn't make use of the rowsource property, but it does the same thing.

Private Sub AddArray()
Dim i As Long
'Your array should already be filled at this point
For i = 0 To UBound(MyArray)
UserForm1.ComboBox1.AddItem MyArray(i)
Next i
End Sub

I don't quite understand your question regarding the headers. You need the
titles where?

------
Cheers,
Anony


"Mike H." wrote:

I want to set the rowSource Property (The list of the combo box that pops up
when you click the pulldown) to an array that is already built. I try to
type the name of the array in the box but it doesn't allow that. What am I
missing here?
Also, how would the array be set up so that the titles of the columns of
data have a heading?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 471
Default ComboList Source

Your suggestion will satisfy this issue. Regarding the header, that is if I
could display multiple rows of data in the list of data to select from, but
that is now how this object works, so the question is not relevant. Thanks
again for your suggestion.

"Anony" wrote:

This doesn't make use of the rowsource property, but it does the same thing.

Private Sub AddArray()
Dim i As Long
'Your array should already be filled at this point
For i = 0 To UBound(MyArray)
UserForm1.ComboBox1.AddItem MyArray(i)
Next i
End Sub

I don't quite understand your question regarding the headers. You need the
titles where?

------
Cheers,
Anony


"Mike H." wrote:

I want to set the rowSource Property (The list of the combo box that pops up
when you click the pulldown) to an array that is already built. I try to
type the name of the array in the box but it doesn't allow that. What am I
missing here?
Also, how would the array be set up so that the titles of the columns of
data have a heading?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default ComboList Source

Maybe...

Option Explicit
Private Sub UserForm_Initialize()
dim myArr as Variant
'some test data
myArr = worksheets("sheet999").range("a1:A10").value
'assign the array directly to the list.
Me.Combobox1.List = myArr
End Sub

Mike H. wrote:

I want to set the rowSource Property (The list of the combo box that pops up
when you click the pulldown) to an array that is already built. I try to
type the name of the array in the box but it doesn't allow that. What am I
missing here?
Also, how would the array be set up so that the titles of the columns of
data have a heading?


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default ComboList Source

Ps. The headings (.columnheads) can only be used when you use a .rowsource--a
range on a worksheet.



Mike H. wrote:

I want to set the rowSource Property (The list of the combo box that pops up
when you click the pulldown) to an array that is already built. I try to
type the name of the array in the box but it doesn't allow that. What am I
missing here?
Also, how would the array be set up so that the titles of the columns of
data have a heading?


--

Dave Peterson


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
combolist array. Sjakkie Excel Programming 2 March 1st 07 01:58 PM
How change link source in long formula when source moved Irina Excel Programming 4 June 28th 06 07:27 AM
How can i set the source-data-range of pivottable2 to the source . Piet Excel Discussion (Misc queries) 0 March 5th 05 09:31 PM
How do I initialize a ComboList Box control from a range in an ex. ken Excel Programming 1 December 15th 04 04:25 PM
Available printers in a dropdown-combolist? NorTor Excel Programming 2 September 7th 03 05:21 PM


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