PC Review


Reply
Thread Tools Rate Thread

Add Values in a comma separated cell to combobox

 
 
k3holdings@gmail.com
Guest
Posts: n/a
 
      2nd Dec 2008
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
 
Reply With Quote
 
 
 
 
Stefi
Guest
Posts: n/a
 
      2nd Dec 2008
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


„(E-Mail Removed)” 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
>

 
Reply With Quote
 
k3holdings@gmail.com
Guest
Posts: n/a
 
      2nd Dec 2008
Thank you Stefi for your reply.
That did excactly what I needed it to.

Much Obliged,
Kyle

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
CSV(comma separated values) files Tony Johansson Microsoft C# .NET 6 12th Aug 2008 03:24 AM
Re: CSV(comma separated values) files John Baird Microsoft C# .NET 0 12th Aug 2008 02:59 AM
Fixing Comma Separated Values (.csv) dickives Microsoft Excel Misc 1 14th Feb 2006 03:26 PM
comma separated values =?Utf-8?B?YmVubnlfamVudA==?= Microsoft Excel New Users 1 24th Nov 2004 12:34 AM
Re: Comma separated values. Duane Hookom Microsoft Access Reports 0 24th Jul 2003 07:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:42 AM.