ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   AddItem Method - Combobox value (https://www.excelbanter.com/excel-programming/295796-re-additem-method-combobox-value.html)

Todd huttenstine

AddItem Method - Combobox value
 
The combobox is located on a worksheet.

ComboBox1.Clear
ComboBox1.AddItem "Jan Week 1"
ComboBox1.AddItem "Jan Week 2"
ComboBox1.AddItem "Jan Week 3"
ComboBox1.AddItem "Jan Week 4"
ComboBox1.AddItem "Jan Week 5"
ComboBox1.AddItem "Jan MTD"

When I use the above code it prevents duplicate values
because of the clear but when I select a value from the
drop down it does not put the value in the combobox. The
combobox is just blank.

Bob Phillips[_6_]

AddItem Method - Combobox value
 
Todd,

It works fine for me. Are you using the DropButtonClick event to populate
it.

Show all the code.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Todd Huttenstine" wrote in message
...
The combobox is located on a worksheet.

ComboBox1.Clear
ComboBox1.AddItem "Jan Week 1"
ComboBox1.AddItem "Jan Week 2"
ComboBox1.AddItem "Jan Week 3"
ComboBox1.AddItem "Jan Week 4"
ComboBox1.AddItem "Jan Week 5"
ComboBox1.AddItem "Jan MTD"

When I use the above code it prevents duplicate values
because of the clear but when I select a value from the
drop down it does not put the value in the combobox. The
combobox is just blank.




Todd huttenstine

AddItem Method - Combobox value
 
yes I am using the code to populate it. Problem is once I
select a value, the value dissapears.


Private Sub ComboBox1_DropButtonClick()
ComboBox1.Clear
ComboBox1.AddItem "Jan Week 1"
ComboBox1.AddItem "Jan Week 2"
ComboBox1.AddItem "Jan Week 3"
ComboBox1.AddItem "Jan Week 4"
ComboBox1.AddItem "Jan Week 5"
ComboBox1.AddItem "Jan MTD"

-----Original Message-----
Todd,

It works fine for me. Are you using the DropButtonClick

event to populate
it.

Show all the code.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Todd Huttenstine"

wrote in message
...
The combobox is located on a worksheet.

ComboBox1.Clear
ComboBox1.AddItem "Jan Week 1"
ComboBox1.AddItem "Jan Week 2"
ComboBox1.AddItem "Jan Week 3"
ComboBox1.AddItem "Jan Week 4"
ComboBox1.AddItem "Jan Week 5"
ComboBox1.AddItem "Jan MTD"

When I use the above code it prevents duplicate values
because of the clear but when I select a value from the
drop down it does not put the value in the combobox.

The
combobox is just blank.



.



All times are GMT +1. The time now is 12:51 PM.

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