Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default dynamically assigning to a combo box

Forgive me as I am new to VB. I am trying to assign items to multiple combo
box lists, selecting the combo box dynamically. There has to be a very
simple way to set a string or value into the parent object of the combo box
that will then dynamically set the combo box object itself. In a simple
version, I am trying to set values into combo boxes named ProductList1 to
ProductList10:

Private Sub LoadComboBox_Click()
Dim i As Integer
For Each validcell In Worksheets("Product List").Range("A2:A100")
For i = 1 To 10
If validcell.Value 0 Then

' This of course will work
ProductList1.AddItem validcell

' As will this
Me.[ProductList1].AddItem validcell

' What I need is this
Me.["ProductList" & i].AddItem validcell

End If
Next i
Next cell
End Sub

This has to be an easy solution, I am just not familiar with the syntax.
Many thanks in advance.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default dynamically assigning to a combo box


HTH

' What I need is this
Me.Controls("ProductList" & i).AddItem validcell

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
linking a form combo box... results from the combo box to another Trey Excel Discussion (Misc queries) 1 July 15th 07 01:58 AM
"Combo Box - getting control combo box to stick in place in worksh ajr Excel Discussion (Misc queries) 1 February 16th 05 02:05 AM
"Combo Box - getting control combo box to stick in place in worksh ajr Excel Discussion (Misc queries) 0 February 15th 05 07:45 PM
Create combo box dynamically Duraiswamy Lingappan Excel Programming 9 July 8th 04 05:09 PM
how to add a combo box in to a excel cell using VBA dynamically? Gamini Jayarathne Excel Programming 1 May 7th 04 11:57 AM


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