Re: Can't populate combobox list with 1 item

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Frank Kabel (frank.kabel_at_freenet.de)
Date: 08/11/04


Date: Wed, 11 Aug 2004 22:55:46 +0200

Hi
use the additem method of your combobox. e.g.
UserForm1.ComboBox1.additem
Price.Range("LMU").Resize(Price.Range("LMU").Rows.Count - 1).Value

--
Regards
Frank Kabel
Frankfurt, Germany
Steph wrote:
> Hi.  I am populating combobox lists with the following code:
>
> UserForm1.ComboBox1.List =
> Price.Range("LMU").Resize(Price.Range("LMU").Rows.Count - 1).Value
>
> I have the ranges set up as named ranges, but for other purposes, i
> have a blank cell as the last cell in each range.  So in order to
> remove that from the list, I am using the Count-1.  This works great
> until I get to a range that has only line in it (well, 2 lines - one
> populated and then the one blank line).
>
> When I run this, I get an error 381 - so apparently the combobox will
> not allow me to populate it's list with only 1 selection??  Is there
> any way around this??
>
> Thanks so much!


Relevant Pages

  • Userform ComboBox entry disappearance problem
    ... different ranges of 96 cells in the sheet. ... combobox lists which are updated each time a commandbutton is fired and ... which copies the combobox value into the specified range. ... run when a commandbutton is clicked. ...
    (microsoft.public.excel.programming)
  • Cant populate combobox list with 1 item
    ... I am populating combobox lists with the following code: ... I have the ranges set up as named ranges, but for other purposes, i have a ...
    (microsoft.public.excel.programming)
  • Re: How do I make a ComboBox use a list from another sheet in Excel?
    ... You could modify it to loop through all your ranges (and make it a combobox). ... > like the lists to in alphabetic order regardless of which list they come from. ...
    (microsoft.public.excel.programming)
  • Re: ComboBox ItemData?
    ... > The idea with the comboboxes was to use them as lists of choosable items. ... > I.e. the possible values the property bound to a combobox could have, ... >> databinding for comboboxes since they contain multiple data ... >>> private void InitializeComponent() ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: ComboBox ItemData?
    ... not clear why you couldn't use complex databinding to accomplish it. ... > fill a combobox with those values. ... >>> The idea with the comboboxes was to use them as lists of choosable ... > private void InitializeComponent() ...
    (microsoft.public.dotnet.framework.compactframework)