PC Review


Reply
 
 
JLong
Guest
Posts: n/a
 
      16th Sep 2004
I am use to add a two dimensional array to a combobox to
populate it, like this combobox.list=array(). In Excel I
couldn't do that, the combobox only has the ListFillRange
property. Is there a way of doing this without using the
FillRange prop.?
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      17th Sep 2004
how about:

Option Explicit
Private Sub UserForm_Initialize()
Dim i As Long
Dim j As Long

Dim myArray(1 To 3, 1 To 2)
'set your values

For i = 1 To 3
For j = 1 To 2
myArray(i, j) = i & "--" & j
Next j
Next i

With Me.ComboBox1
.ColumnCount = 2
.List = myArray
End With
End Sub



JLong wrote:
>
> I am use to add a two dimensional array to a combobox to
> populate it, like this combobox.list=array(). In Excel I
> couldn't do that, the combobox only has the ListFillRange
> property. Is there a way of doing this without using the
> FillRange prop.?


--

Dave Peterson
(E-Mail Removed)
 
Reply With Quote
 
Guest
Posts: n/a
 
      17th Sep 2004
Dave, that is what I normally do. I have never used Excel
VBA before and this combobox doesn't support the List
property. I am using Excel 2000.
 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      17th Sep 2004
Hmmm.

Where is your combobox? On a worksheet or on a userform?

And if it's on a worksheet, how did you make it? With the combobox icon from
the Control Toolbox toolbar or with the Dropdown icon from the Forms toolbar?



(E-Mail Removed) wrote:
>
> Dave, that is what I normally do. I have never used Excel
> VBA before and this combobox doesn't support the List
> property. I am using Excel 2000.


--

Dave Peterson
(E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access Problem: Combobox.setfocus fires combobox.OnClick event Hal Levy Microsoft Access Form Coding 5 31st Jul 2009 03:54 AM
delete fields in subform combobox after main form combobox is chan deb Microsoft Access 4 24th Jan 2008 10:09 PM
ComboBox.Items.Clear() causes the selection of Text inside the edit of the ComboBox Nomasnd Microsoft Dot NET Framework Forms 1 27th Sep 2006 06:32 PM
HowTo? shift focus in VBA IDE between Object combobox, procedure combobox, and Code window Malcolm Cook Microsoft Access 0 11th Oct 2005 03:42 PM
Bug: Combobox.dropdown = True during Form.New() causes listbox to be disabled, even though combobox is Enabled. =?Utf-8?B?UmF0a2lsZXk=?= Microsoft Dot NET Framework Forms 1 12th Feb 2004 09:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:50 AM.