Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Combobox list items

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"
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Combobox list items

Combobox1.Value = "List Item 1"

--

HTH

Bob Phillips

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

"joeeng" wrote in message
...
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"



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Combobox list items

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" wrote in message
...
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"




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default Combobox list items

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" wrote in message
...
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
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
Combobox items determined by the selection in another combobox Alerion Excel Programming 2 September 13th 06 01:07 PM
Using a combobox to eliminate items from a list jnf40 Excel Programming 0 July 26th 06 10:37 PM
formatting the list items for ComboBox created using Forms Desmond Excel Discussion (Misc queries) 3 May 4th 06 10:04 AM
named range, data validation: list non-selected items, and new added items KR Excel Discussion (Misc queries) 1 June 24th 05 05:21 AM
missing items in sheet's activex list/combobox after resizing range Tim Zych[_2_] Excel Programming 1 August 11th 03 10:48 PM


All times are GMT +1. The time now is 03:20 AM.

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"