.additem

  • Thread starter Thread starter Robert Couchman
  • Start date Start date
R

Robert Couchman

Hi all,

i am trying to create a list for a combobox using a
collection, only problem is that the collection is text
and i am trying to use the following:=

for each w in coll
.additem
next w

DOESNT work cause it isnt adding any data, it is just
adding a blank enterty!

can anyone please let me know how??

if it helps the collection is holding data cells
(i, "B").text, cells(i, "D").text


Thank you,

Robert Couchman
 
You are just adding blank items because you are not telling the program to
do anything else.

Traditionally you add a value to the combo box by:
combo1.additem "myitem1"
or
combo1.additem variablename

You probably need to add something after your .additem ...perhaps
".additem w"

....haven't tried it ...but just a thought
 
You have to tell it what to add. Here is some code that works :-

'------------------------------------------------------
FindForm.BookCombo.Clear
For Each wb In Workbooks()
FindForm.BookCombo.AddItem (wb.Name)
Next
'------------------------------------------------------------
 
Thank you Bob,

this is much more logical, but i have already got
information in my collection.

the difficult part is trying to get that info out!

my collection holds data from columns B, C, D and only
outputs ""

which means i am calling the data incorrectly, yes??

thank you,

Robert Couchman
 
Back
Top