#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default .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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default .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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default .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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default .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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
additem to combobox with an array jocke Excel Discussion (Misc queries) 2 September 29th 05 07:56 PM
Help with: ListBox1.AddItem (ws.Name) Ron de Bruin Excel Worksheet Functions 0 May 18th 05 07:02 PM
additem listbox CG Rosén Excel Programming 2 December 14th 03 08:58 PM
Combo Box addItem question strataguru[_9_] Excel Programming 1 November 4th 03 10:11 PM
additem to listbox built on the fly Tom Ogilvy Excel Programming 1 July 23rd 03 04:25 PM


All times are GMT +1. The time now is 08:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"