ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I enter values in a Combo Box with Excel (https://www.excelbanter.com/excel-programming/355828-how-do-i-enter-values-combo-box-excel.html)

James-pps

How do I enter values in a Combo Box with Excel
 
Hi,
I'm struggling to enter values into a Combo Box, I understand that I need to
Script it, but can't work out how! I've tried using the Help function in VB
section but to no avail.

Thanks
James

Chip Pearson

How do I enter values in a Combo Box with Excel
 
James,

Try some code like the following:

With UserForm1.ComboBox1
.AddItem "a"
.AddItem "b"
.AddItem "co"
End With



"James-pps" wrote in
message
...
Hi,
I'm struggling to enter values into a Combo Box, I understand
that I need to
Script it, but can't work out how! I've tried using the Help
function in VB
section but to no avail.

Thanks
James




davesexcel[_61_]

How do I enter values in a Combo Box with Excel
 

where did you get the combo box from??

Control ToolBox
or
Forms ToolBox

Make a list in your worksheet
Name the list by highliting it and then goto=insert=name=define
put a one word name in the name box
if you used the combo box from the controll toolbox then..
right click on the combobox select properties, find rowsource and enter
the named range, now your box is populated,

Combobox from the forms toolbar,
rightclick on the combo box
select format control
select the control tab
input range, enter the range name or you can just click on the squarde
button and go to the range and highlite it and click ok

If you are using a combo Box for a UserForm you can populate it the
same way as the first explaination,
select the combobox on the userform, be sure it says combobox on the
properties window, go down to row source and enter the name of the
range


--
davesexcel
------------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708
View this thread: http://www.excelforum.com/showthread...hreadid=521674


James-pps[_2_]

How do I enter values in a Combo Box with Excel
 
Thanks, I've tried that but when I click the arrow, I get a blank dropdown
line.

However I have found a way of doing it, instead of selecting a Combo Box
from the Control Toolbox, I inserted one from the Forms Toolbox. Then I could
right click on the object, select Format Control, and then under the control
tab, enter an input range for criteria.

Thanks for your prompt reply :)

James

"Chip Pearson" wrote:

James,

Try some code like the following:

With UserForm1.ComboBox1
.AddItem "a"
.AddItem "b"
.AddItem "co"
End With



"James-pps" wrote in
message
...
Hi,
I'm struggling to enter values into a Combo Box, I understand
that I need to
Script it, but can't work out how! I've tried using the Help
function in VB
section but to no avail.

Thanks
James





OverAC[_8_]

How do I enter values in a Combo Box with Excel
 

Dears

And I wonder how we can choose the combobox to enter without using
mouse.

Regards.
OverAC


--
OverAC
------------------------------------------------------------------------
OverAC's Profile: http://www.excelforum.com/member.php...o&userid=32396
View this thread: http://www.excelforum.com/showthread...hreadid=521674



All times are GMT +1. The time now is 02:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com