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

I am confused as to which option (Listbox or Combobox) to use when.

I am designing a userform to input information pertaining to a flight plan.
Instances where I would use either listbox or combobox would be to:

1) list various airports that are listed on worksheet "Airports"
2) list different planes a pilot is certified to fly

I do not want the user to be able to add to the list. The only way
something can be added is if information about the plane or airport is
entered on a spreadsheet and the combobox/listbox will pick up the new info
automatically.

Can you please explain what the defining difference is between the two
different options so I can decide what to use?

Thanks,
Les
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Listbox vs Combobox

They are very similar. A Listbox does not allow
the user to add to the list; a Combobox does but
that property can be disabled in design. Both
allow MatchEntry -- a user can type in letter(s)
and get the first match. Comboboxes usually take
less space, since only one item is shown, except
when the user clicks the drop down arrow.

Hth,
Merjet

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Listbox vs Combobox

Both do much the same thing but there are a few nuiances. Generally I use
combo boxes when I expect the user to give a single answer and list boxes
when I expect the user to (possibly) select more than one answer. That being
said it also depends on whether I want the user to see multiple items in the
list of just a single item. A single item will make the form look a little
cleaner but if the list is short then it is faster for the end user to just
select from the list without scrolling or such.
--
--
HTH...

Jim Thomlinson


"WLMPilot" wrote:

I am confused as to which option (Listbox or Combobox) to use when.

I am designing a userform to input information pertaining to a flight plan.
Instances where I would use either listbox or combobox would be to:

1) list various airports that are listed on worksheet "Airports"
2) list different planes a pilot is certified to fly

I do not want the user to be able to add to the list. The only way
something can be added is if information about the plane or airport is
entered on a spreadsheet and the combobox/listbox will pick up the new info
automatically.

Can you please explain what the defining difference is between the two
different options so I can decide what to use?

Thanks,
Les

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 470
Default Listbox vs Combobox

Thanks, it looks like I am going to use a combobox, but I do not want the
user to be able to add to the list via the combobox. How is that disabled?

Also, how do I populate the combobox? The way my data is set up for
Airports is that each Airport and its information takes a column, ie if four
airports are listed on the worksheet "Airports", the column C, D, E, and F
are used. This list will grow so I do not need a fixed endpoint, but a
floating endpoint. I am guessing something like xlRight. But I do not know
where to go from there. The data is located in
C1:F1, currently, but again it can grow to G1, H1, I1, etc.

Thanks,
Les

"merjet" wrote:

They are very similar. A Listbox does not allow
the user to add to the list; a Combobox does but
that property can be disabled in design. Both
allow MatchEntry -- a user can type in letter(s)
and get the first match. Comboboxes usually take
less space, since only one item is shown, except
when the user clicks the drop down arrow.

Hth,
Merjet


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Listbox vs Combobox

It's easier to populate a ComboBox when all the items
are in one column, but in one row is doable. To disable
allowing the user to add items, include the next-to-last
line below, or set it in the Properties Window.

Private Sub UserForm_Initialize()
Dim c1 As Range
Dim c2 As Range
Dim iCol As Integer

Set c1 = Sheets("Airports").Range("C1")
Set c2 = c1.End(xlToRight)
For iCol = 3 To c2.Column
ComboBox1.AddItem c1.Offset(0, iCol - 3).Value
Next iCol
ComboBox1.Style = fmStyleDropDownList
End Sub

Hth,
Merjet



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 470
Default Listbox vs Combobox

Thanks for your help!
Les

"merjet" wrote:

It's easier to populate a ComboBox when all the items
are in one column, but in one row is doable. To disable
allowing the user to add items, include the next-to-last
line below, or set it in the Properties Window.

Private Sub UserForm_Initialize()
Dim c1 As Range
Dim c2 As Range
Dim iCol As Integer

Set c1 = Sheets("Airports").Range("C1")
Set c2 = c1.End(xlToRight)
For iCol = 3 To c2.Column
ComboBox1.AddItem c1.Offset(0, iCol - 3).Value
Next iCol
ComboBox1.Style = fmStyleDropDownList
End Sub

Hth,
Merjet


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
Listbox vs Combobox WLMPilot Excel Programming 3 February 16th 07 10:00 PM
comboBox vs Listbox Steve Excel Programming 2 March 14th 06 12:23 AM
Combobox v Listbox MBlake New Users to Excel 5 April 24th 05 11:58 AM
Combobox/listbox FSt1 Excel Discussion (Misc queries) 3 January 4th 05 06:55 PM
Combobox or Listbox Kathy[_7_] Excel Programming 2 December 4th 03 03:48 PM


All times are GMT +1. The time now is 04:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"