Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Add Values in a comma separated cell to combobox

Hey all,

I have a ComboBox on a Userform that I want to populate with a list of
choices from a single cell. The cell has values like Yes, No, Maybe, I
Don't Know. They are all separated with a comma. Is there a way to do
this?

Right now if I do this

With ComboBox1
.AddItem (The Cell I want)
End With

The ComboBox gets populated with all the cell contents on a single
line.
I would like each string separated by a comma in the cell, to be on a
separate line in the ComboBox.

Any ideas will be appreciated.

Thanks,
Kyle
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Add Values in a comma separated cell to combobox

Try this:
Sub test()
optarray = Split(Range("A1"), ",")
With ActiveSheet.ComboBox1
.Clear
For opt = 0 To UBound(optarray)
.AddItem (optarray(opt))
Next opt
End With
End Sub

Regards,
Stefi


ezt *rta:

Hey all,

I have a ComboBox on a Userform that I want to populate with a list of
choices from a single cell. The cell has values like Yes, No, Maybe, I
Don't Know. They are all separated with a comma. Is there a way to do
this?

Right now if I do this

With ComboBox1
.AddItem (The Cell I want)
End With

The ComboBox gets populated with all the cell contents on a single
line.
I would like each string separated by a comma in the cell, to be on a
separate line in the ComboBox.

Any ideas will be appreciated.

Thanks,
Kyle

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Add Values in a comma separated cell to combobox

Thank you Stefi for your reply.
That did excactly what I needed it to.

Much Obliged,
Kyle

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
How to I create a comma separated values file Ruby Excel Discussion (Misc queries) 4 July 25th 09 02:12 PM
Fixing Comma Separated Values (.csv) dickives Excel Discussion (Misc queries) 1 February 14th 06 03:26 PM
summing comma separated values in a range rjamison Excel Programming 0 June 14th 05 12:14 AM
summing comma separated values in a range bthoron Excel Programming 7 April 20th 05 05:32 PM
CSV (Comma Separated Values) delimiter ? Lisa Pearlson Excel Programming 6 January 6th 04 02:30 PM


All times are GMT +1. The time now is 02:57 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"