PC Review


Reply
Thread Tools Rate Thread

Combobox list items

 
 
=?Utf-8?B?am9lZW5n?=
Guest
Posts: n/a
 
      27th Nov 2006
Can a Combobox list contain only one item? For instance,

Combobox.List = "List Item 1"
or
Combobox.List = Range(Cells(1,1),cells(1+Ivalue,1)).Value
where Ivalue=0 sometimes

I keep getting an error "List property cannot be set"
 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      27th Nov 2006
Combobox1.Value = "List Item 1"

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"joeeng" <(E-Mail Removed)> wrote in message
news:E5550455-3C68-47D2-A8F9-(E-Mail Removed)...
> Can a Combobox list contain only one item? For instance,
>
> Combobox.List = "List Item 1"
> or
> Combobox.List = Range(Cells(1,1),cells(1+Ivalue,1)).Value
> where Ivalue=0 sometimes
>
> I keep getting an error "List property cannot be set"



 
Reply With Quote
 
=?Utf-8?B?am9lZW5n?=
Guest
Posts: n/a
 
      27th Nov 2006
I actually want the list to have only one item at times and many items at
other times.

"Bob Phillips" wrote:

> Combobox1.Value = "List Item 1"
>
> --
>
> HTH
>
> Bob Phillips
>
> (replace xxxx in the email address with gmail if mailing direct)
>
> "joeeng" <(E-Mail Removed)> wrote in message
> news:E5550455-3C68-47D2-A8F9-(E-Mail Removed)...
> > Can a Combobox list contain only one item? For instance,
> >
> > Combobox.List = "List Item 1"
> > or
> > Combobox.List = Range(Cells(1,1),cells(1+Ivalue,1)).Value
> > where Ivalue=0 sometimes
> >
> > I keep getting an error "List property cannot be set"

>
>
>

 
Reply With Quote
 
=?Utf-8?B?Q2hhcmxlcyBDaGlja2VyaW5n?=
Guest
Posts: n/a
 
      27th Nov 2006
Joe, try either looping through your range and using the .AddItem method or
set the .RowSource of the combobox to your range. For example:
Dim rCell as Range
Dim r as Range
Set r = Range("A1:A10")
For Each r in rCell.Cells
ComboBox1.AddItem r
Next

or more simply:
Dim r as Range
Set r = Range("A1:A10")
ComboBox1.RowSource = r.Address

--
Charles Chickering

"A good example is twice the value of good advice."


"joeeng" wrote:

> I actually want the list to have only one item at times and many items at
> other times.
>
> "Bob Phillips" wrote:
>
> > Combobox1.Value = "List Item 1"
> >
> > --
> >
> > HTH
> >
> > Bob Phillips
> >
> > (replace xxxx in the email address with gmail if mailing direct)
> >
> > "joeeng" <(E-Mail Removed)> wrote in message
> > news:E5550455-3C68-47D2-A8F9-(E-Mail Removed)...
> > > Can a Combobox list contain only one item? For instance,
> > >
> > > Combobox.List = "List Item 1"
> > > or
> > > Combobox.List = Range(Cells(1,1),cells(1+Ivalue,1)).Value
> > > where Ivalue=0 sometimes
> > >
> > > I keep getting an error "List property cannot be set"

> >
> >
> >

 
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
ComboBox list isn't complete, gets cut off at 10000 items... Maury Markowitz Microsoft Access Form Coding 4 9th May 2009 03:16 PM
Add items to comboBox how dropdown list resized mawenb@gmail.com Microsoft C# .NET 1 3rd Feb 2007 08:04 AM
Using a combobox to eliminate items from a list =?Utf-8?B?am5mNDA=?= Microsoft Excel Programming 0 26th Jul 2006 10:37 PM
ComboBox: How can I limit user to list items? A.M-SG Microsoft Dot NET Framework Forms 2 30th Jan 2006 02:16 AM
How to Add items to a ComboBox list JDP@Work Microsoft Powerpoint 11 12th Jul 2004 04:26 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:45 AM.