ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   combobx help! (https://www.excelbanter.com/excel-programming/310185-combobx-help.html)

picric

combobx help!
 
I have a range in Sheet1 A1:A10. I need to populate the
drop down box of a combo box with the values in Sheet1
A1:A10 that are not equal to "no".

Mike Mertes

combobx help!
 
Picric,

I would write some code to enumerate the elements and test them all
individually, something like this:

Dim X as INT

For X = 1 to 10

If Thisworkbook.Worksheets("Sheet1").Range("A" & X).value = "No" then _
ComboBox1.additem Thisworkbook.Worksheets("Sheet1").Range("A" & X).value

Next X


Or you could probably create a collection element of cells and do something
like

With Cells in Collection (or range)

if .value = "No" then... etc.

End with


Hope that's a good start :)

-Mike Mertes

"picric" wrote in message
...
I have a range in Sheet1 A1:A10. I need to populate the
drop down box of a combo box with the values in Sheet1
A1:A10 that are not equal to "no".





All times are GMT +1. The time now is 04:10 AM.

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