Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clear empty rows in combobox

Status
Not open for further replies.

wmbb

Technical User
Jul 17, 2005
320
NL
I'm populating a combobox in a userform using an array called arrsem
I've defined the array and populated the combobox using
Code:
Dim arrsem(6)
cmb_system.List = arrsem

arrsem is an array filled in a procedure depending on a choice of the user.
If, for instance, only the 2nd and 4th item of arrsem is filled how can I remove the empty lines in the combobox

arrsem(0) = ""
arrsem(1) = "london"
arrsem(2) = ""
arrsem(3) = "berlin"
arrsem(4) = ""
arrsem(5) = ""
arrsem(6) =
 
Either prevent the array from containing zero length strings or load the combobox in a loop, testing each array value.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Okay,

Skip thanks for your reaction.
I have solved this in another way using a dynamic array, count the items in the array which are not equal to "" and then redim a new array using this info.

I was hoping there was a more simple solution for this.




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top