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

I am new with combobox stuff. I have created one but how do you populate
with an array$ using vba. where do you write code?
A small example would be appreciated. Can't find a simple via google.

Thank


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default POPULATE combobox

Private Sub CommandButton1_Click()
arrTemp = Array(1, 2, 3, 4, 5)
For intTemp = 0 To UBound(arrTemp)
UserForm1.ComboBox1.AddItem arrTemp(intTemp)
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"sunilpatel" wrote:

I am new with combobox stuff. I have created one but how do you populate
with an array$ using vba. where do you write code?
A small example would be appreciated. Can't find a simple via google.

Thank



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default POPULATE combobox

If you already have an array and you're creating a userform, you can use that
userform's initialize procedure.

Option Explicit
Private Sub UserForm_Initialize()

dim myArr as variant
myArr = array("a","b","c") 'or however you determined the array

me.combobox1.list = myArr

End Sub

sunilpatel wrote:

I am new with combobox stuff. I have created one but how do you populate
with an array$ using vba. where do you write code?
A small example would be appreciated. Can't find a simple via google.

Thank


--

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
Populate combobox with sql from DAO dan dungan Excel Programming 1 January 29th 09 10:12 PM
Populate a ComboBox Greg Maxey[_3_] Excel Programming 3 March 22nd 07 06:23 PM
use selected value from one combobox to populate another combobox rjudge[_7_] Excel Programming 3 April 14th 06 02:01 PM
Populate combobox Pat Excel Programming 1 December 10th 04 05:33 PM
Populate a combobox Rory[_3_] Excel Programming 2 June 9th 04 04:20 PM


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