Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
.additem
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
.additem
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 "Robert Couchman" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
.additem
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 '------------------------------------------------------------ -- Message posted from http://www.ExcelForum.com |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
.additem
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 '------------------------------------------------------ FindForm.BookCombo.Clear For Each wb In Workbooks() FindForm.BookCombo.AddItem (wb.Name) Next '--------------------------------------------------------- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
additem to combobox with an array | Excel Discussion (Misc queries) | |||
Help with: ListBox1.AddItem (ws.Name) | Excel Worksheet Functions | |||
additem listbox | Excel Programming | |||
Combo Box addItem question | Excel Programming | |||
additem to listbox built on the fly | Excel Programming |