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


hey all, easy question, cant find answer anywhere

How do I add items to a combo box in a VBA Form at design mode? Ther
is a LIST property but I can only add 1 item?

Thanks in advance

--
krhym
-----------------------------------------------------------------------
krhyme's Profile: http://www.excelforum.com/member.php...fo&userid=2522
View this thread: http://www.excelforum.com/showthread.php?threadid=39660

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default VBA combo box

Scroll down to the RowSource property.

Type in the range you want--if you're picking the list from a range.

If you're adding items one at at time, you could do it in the
UserForm_Initialize subroutine:

with me.combobox1
.additem "a"
.additem "b"
.additem "x"
end with

or even:
Dim myList As Variant
myList = Array("a", "b", "x")
Me.ComboBox1.List = myList



krhyme wrote:

hey all, easy question, cant find answer anywhere

How do I add items to a combo box in a VBA Form at design mode? There
is a LIST property but I can only add 1 item?

Thanks in advance!

--
krhyme
------------------------------------------------------------------------
krhyme's Profile: http://www.excelforum.com/member.php...o&userid=25225
View this thread: http://www.excelforum.com/showthread...hreadid=396601


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA combo box


Perfect, Thanks Dave!


--
krhyme
------------------------------------------------------------------------
krhyme's Profile: http://www.excelforum.com/member.php...o&userid=25225
View this thread: http://www.excelforum.com/showthread...hreadid=396601

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA combo box


It only shows the first item from my range, i tried ways:

1. Sheet1:A1:A5 in rowSource

2. insert--name-- define and listName in rowSource

My items are side by side instead of one of top of eachother, could
that be a problem?


--
krhyme
------------------------------------------------------------------------
krhyme's Profile: http://www.excelforum.com/member.php...o&userid=25225
View this thread: http://www.excelforum.com/showthread...hreadid=396601

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 reference on another combo box for picking address etc. kbjin Excel Worksheet Functions 1 December 8th 06 03:29 PM
Can one combo box control the data in a different combo box MarkM Excel Discussion (Misc queries) 5 October 9th 06 11:44 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


All times are GMT +1. The time now is 01:52 PM.

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"