Excel combobox with checkboxes

Excel for Microsoft 365 Excel 2021 Excel 2019 Excel 2016 Excel 2013 Excel 2010 Excel 2007 Excel Starter 2010 More…Less

When you want to display a list of values that users can choose from, add a list box to your worksheet.

Sample list box

Add a list box to a worksheet

  1. Create a list of items that you want to displayed in your list box like in this picture.

    value list for use in combo box

  2. Click Developer > Insert.

    Note: If the Developer tab isn’t visible, click File > Options > Customize Ribbon. In the Main Tabs list, check the Developer box, and then click OK.

  3. Under Form Controls, click List box (Form Control).

    the list box form control button

  4. Click the cell where you want to create the list box.

  5. Click Properties > Control and set the required properties:

    Proprties for the list box control.

    • In the Input range box, type the range of cells containing the values list.

      Note: If you want more items displayed in the list box, you can change the font size of text in the list.

    • In the Cell link box, type a cell reference.

      Tip: The cell you choose will have a number associated with the item selected in your list box, and you can use that number in a formula to return the actual item from the input range.

    • Under Selection type, pick a Single and click OK.

      Note: If you want to use Multi or Extend, consider using an ActiveX list box control.

Add a combo box to a worksheet

You can make data entry easier by letting users choose a value from a combo box. A combo box combines a text box with a list box to create a drop-down list.

Combo box

You can add a Form Control or an ActiveX Control combo box. If you want to create a combo box that enables the user to edit the text in the text box, consider using the ActiveX Combo Box. The ActiveX Control combo box is more versatile because, you can change font properties to make the text easier to read on a zoomed worksheet and use programming to make it appear in cells that contain a data validation list.

  1. Pick a column that you can hide on the worksheet and create a list by typing one value per cell.

    value list for use in combo box

    Note: You can also create the list on another worksheet in the same workbook.

  2. Click Developer > Insert.

    Note: If the Developer tab isn’t visible, click File > Options > Customize Ribbon. In the Main Tabs list, check the Developer box, and then click OK.

  3. Pick the type of combo box you want to add:

    • Under Form Controls, click Combo box (Form Control).

      Or

    • Under ActiveX Controls, click Combo Box (ActiveX Control).

      Insert combo box

  4. Click the cell where you want to add the combo box and drag to draw it.

Tips: 

  • To resize the box, point to one of the resize handles, and drag the edge of the control until it reaches the height or width you want.

  • To move a combo box to another worksheet location, select the box and drag it to another location.

Format a Form Control combo box

  1. Right-click the combo box and pick Format Control.

  2. Click Control and set the following options:

    Format control dialog box

    • Input range: Type the range of cells containing the list of items.

    • Cell link: The combo box can be linked to a cell where the item number is displayed when you select an item from the list. Type the cell number where you want the item number displayed.

      For example, cell C1 displays 3 when the item Sorbet is selected, because it’s the third item in our list.

      Linked cell shows item number when item is selected.

      Tip: You can use the INDEX function to show an item name instead of a number. In our example, the combo box is linked to cell B1 and the cell range for the list is A1:A2. If the following formula, is typed into cell C1: =INDEX(A1:A5,B1), when we select the item «Sorbet» is displayed in C1.

      Enter formula to show item from linked cell

    • Drop-down lines: The number of lines you want displayed when the down arrow is clicked. For example, if your list has 10 items and you don’t want to scroll you can change the default number to 10. If you type a number that’s less than the number of items in your list, a scroll bar is displayed.

      Scroll bar is displayed.

  3. Click OK.

Format an ActiveX combo box

  1. Click Developer > Design Mode.

  2. Right-click the combo box and pick Properties, click Alphabetic, and change any property setting that you want.

    Here’s how to set properties for the combo box in this picture:

    Example of a combo box.

    Property settings for ActiveX combo box.

    To set this property

    Do this

    Fill color

    Click BackColor > the down arrow > Pallet, and then pick a color.

    Color fill property for a combo box.

    Font type, style or size

    Click Font > the button and pick font type, size, or style.

    Setting for fonts in text box

    Font color

    Click ForeColor > the down arrow > Pallet, and then pick a color.

    Link a cell to display selected list value.

    Click LinkedCell

    Link Combo Box to a list

    Click the box next to ListFillRange and type the cell range for the list.

    Change the number of list items displayed

    Click the ListRows box and type the number of items to be displayed.

  3. Close the Property box and click Designer Mode.

  4. After you complete the formatting, you can right-click the column that has the list and pick Hide.

Need more help?

You can always ask an expert in the Excel Tech Community or get support in the Answers community.

See Also

Overview of forms, Form controls, and ActiveX controls on a worksheet

Add a check box or option button (Form controls)

Need more help?

Ципихович Эндрю

1508 / 478 / 56

Регистрация: 10.04.2009

Сообщений: 8,008

1

03.09.2011, 21:06. Показов 7402. Ответов 17

Метки нет (Все метки)


Студворк — интернет-сервис помощи студентам

По большому счёту фантастика, увидел пример в сети, у меня не получилось, не подскажите пример кривой или это не возможно, или …
_________________________________
Данный пример покажет, как можно вставить элемент CheckBox внутрь элемента ComboBox. Добавьте на форму 1 ComboBox и 1 CheckBox.

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Private Const EC_LEFTMARGIN = &H1 
Private Const EC_RIGHTMARGIN = &H2 
Private Const EC_USEFONTINFO = &HFFFF& 
Private Const EM_SETMARGINS = &HD3& 
Private Const EM_GETMARGINS = &HD4& 
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hwndParent As Long, ByVal hwndChildAfter As Long, ByVal lpszClass As String, ByVal lpszWindow As String) As Long 
Private Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
 
Private Sub AddCheckToCombo(ByRef chkThis As CheckBox, ByRef cboThis As ComboBox) 
Dim lhWnd As Long 
Dim lMargin As Long 
lhWnd = FindWindowEx(cboThis.hwnd, 0, "EDIT", vbNullString) 
If (lhWnd <> 0) Then 
lMargin = chkThis.Width  Screen.TwipsPerPixelX + 2 
SendMessageLong lhWnd, EM_SETMARGINS, EC_LEFTMARGIN, lMargin 
chkThis.BackColor = cboThis.BackColor 
chkThis.Move cboThis.Left + 3 * Screen.TwipsPerPixelX, cboThis.Top + 2 * Screen.TwipsPerPixelY, chkThis.Width, cboThis.Height - 4 * Screen.TwipsPerPixelY 
chkThis.ZOrder 
End If 
End Sub
 
Private Sub Form_Load() 
AddCheckToCombo Check1, Combo1 
Dim i As Long 
For i = 1 To 20 
Combo1.AddItem "Test" & i 
Next i 
End Sub



0



Programming

Эксперт

94731 / 64177 / 26122

Регистрация: 12.04.2006

Сообщений: 116,782

03.09.2011, 21:06

17

1161 / 287 / 23

Регистрация: 28.09.2008

Сообщений: 553

04.09.2011, 09:20

2

Цитата
Сообщение от Ципихович Эндрю
Посмотреть сообщение

не подскажите пример кривой или это не возможно, или …

Да нет, пример рабочий, но только в Visual Basic, в VBA почему то не хочет пахать.



0



1508 / 478 / 56

Регистрация: 10.04.2009

Сообщений: 8,008

04.09.2011, 09:47

 [ТС]

3

а где работает???



0



Busine2009

Заблокирован

06.09.2011, 17:40

4

Ципихович Эндрю,
нелогично использовать в ComboBoxе флажки (выбор нескольких пунктов). ComboBox предназначен для выбора одного элемента и для отображения его в Поле.

Можно радиокнопки добавить: ListStyle: 1-fmListStyelOption



0



1508 / 478 / 56

Регистрация: 10.04.2009

Сообщений: 8,008

06.09.2011, 18:49

 [ТС]

5

да я согласен, просто был пример в сети, меня он удивил, решил посмотреть, он ещё и не прёт

Добавлено через 29 секунд

Цитата
Сообщение от Busine2009
Посмотреть сообщение

нелогично использовать в ComboBoxе флажки

можно придумать



0



Busine2009

Заблокирован

06.09.2011, 19:01

6

Цитата
Сообщение от Ципихович Эндрю
Посмотреть сообщение

можно придумать

я считаю, что нужно использовать каждый элемент управления по своему назначению.



0



1508 / 478 / 56

Регистрация: 10.04.2009

Сообщений: 8,008

06.09.2011, 19:09

 [ТС]

7

ОСХ для чего создают, для удобства
кстати, есть у Вас какие нибудь интересные, у меня есть, (могу выложить), но интерисуют симбиозы например комбобокс +кнопка и т. д.



0



Busine2009

Заблокирован

06.09.2011, 19:12

8

Ципихович Эндрю,
нет, нету. Я основ VBA до конца ещё не знаю.



0



1508 / 478 / 56

Регистрация: 10.04.2009

Сообщений: 8,008

06.09.2011, 19:19

 [ТС]

9

а кто ж его знает ))



0



ironegg

1904 / 781 / 31

Регистрация: 11.02.2010

Сообщений: 1,567

07.09.2011, 10:50

10

Цитата
Сообщение от Ципихович Эндрю
Посмотреть сообщение

как можно вставить элемент CheckBox внутрь элемента ComboBox

возможно, подойдет элемент управления ListView (ToolBox — Additional controls — Microsoft ListView Control).
вот пример кода

Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
Private Sub UserForm_Initialize()
 ListView1.CheckBoxes = True
 ListView1.View = lvwList
 End Sub
 
 Private Sub CommandButton1_Click()
 ListView1.ListItems.Add(1) = "выбери меня"
 ListView1.ListItems.Add(2) = "нет! меня!"
 End Sub
 
 Private Sub ListView1_ItemCheck(ByVal Item As MSComctlLib.ListItem)
 MsgBox Item
 End Sub



0



1508 / 478 / 56

Регистрация: 10.04.2009

Сообщений: 8,008

07.09.2011, 11:01

 [ТС]

11

спасибо, что-то так и не понятно, что на форме должно быть кроме кнопки??



0



Busine2009

Заблокирован

07.09.2011, 11:18

12

CheckBoxы можно использовать и на стандартном элементе управления — ListBox.
Для этого нужно установить следующие свойства ListBox:
MultiSelect: 1-fmMultiSelectMulti;
ListStyle: 1 — fmListStyleOption.



0



1508 / 478 / 56

Регистрация: 10.04.2009

Сообщений: 8,008

07.09.2011, 11:24

 [ТС]

13

понятно, Вы пробовали??
у меня выделяет
Private Sub ListView1_ItemCheck(ByVal Item As MSComctlLib.ListItem)



0



Busine2009

Заблокирован

07.09.2011, 11:29

14

Ципихович Эндрю,
ViewProperties Window. И установите указанные выше пункты в свойствах ListBox.



0



1508 / 478 / 56

Регистрация: 10.04.2009

Сообщений: 8,008

07.09.2011, 11:34

 [ТС]

15

да конечно ставил и назвал его ListView1



0



Busine2009

Заблокирован

07.09.2011, 11:37

16

Цитата
Сообщение от Ципихович Эндрю
Посмотреть сообщение

понятно, Вы пробовали??

кто пробовал?
Я просто думал вы меня спросили.



0



1508 / 478 / 56

Регистрация: 10.04.2009

Сообщений: 8,008

07.09.2011, 11:41

 [ТС]

17

Цитата
Сообщение от Busine2009
Посмотреть сообщение

кто пробовал?

по большому счёту хоть кто-то



0



Busine2009

Заблокирован

07.09.2011, 11:43

18

Ципихович Эндрю,
просто я писал про ListBox.



0



  • Remove From My Forums
  • Question

  • Hi all,

    I am have win7 and Excel 2010.  I like to ask if there is a way for me to dropdown list in a cell with checkboxes for each of the available items, in a way that is very much like when I create a filter.

    The reason is that I need it to be dynamic, so that based on what the user have selected in the dropdown using the checkboxes, I can show/hide data.  The other reason is this would like the list to grow or shrink dynamically with little maintenance.
     Is this feature feasible whether through the menu on the ribbon or programmatically?

    Thanks in advance,

    Gerry

Answers

  • Hi,

    >>I like to ask if there is a way for me to dropdown list in a cell with checkboxes for each of the available items, in a way that is very much like when I create a filter.<<

    I’m afraid there is no way to insert checkboxes into the items of Combobox in Excel.

    >>based on what the user have selected in the dropdown using the checkboxes, I can show/hide data.<<

    Since you just want to multiple select in combobox, you can consider using
    List box Control to replace combobox as followed. You can set its
    multiSelect property with «1-fmMultiSelectMulti» to achieve the goal.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

    Click
    HERE to participate the survey.

    • Marked as answer by

      Thursday, October 2, 2014 3:03 PM

What is a Combo Box in Excel?

A combo box in Excel is a data validation tool that can create a drop-down list for the user to select from the predetermined list. A “Form Control” is available in the “Insert” tab of the “Developer” tab. In simple words, it is a list box where we can put a different list of values for selection. Whereas the VBA combo box is designed in a user form where we put our values in a list in Excel, the VBA combo box has the same functionality.

Table of contents
  • What is a Combo Box in Excel?
    • Types
    • #1 How to Create Form Controls Combo Box in Excel?
    • #2 How to Create an Active X Controls Combo Box in Excel?
    • Recommended Articles

Types

  1. Form Controls Combo BoxExcel Form Controls are objects which can be inserted at any place in the worksheet to work with data and handle the data as specified. These controls are compatible with excel and can create a drop-down list in excel, list boxes, spinners, checkboxes, scroll bars.read more
  2. Active X Controls

#1 How to Create Form Controls Combo Box in Excel?

You can download this Combo Box Excel Template here – Combo Box Excel Template

Below are the steps to create form controls combo box in Excel:

  1. We have created a “Month List” in the worksheet.

    Combo in Excel - step 5

  2. First, we must click on Developer Tab > Insert > Combo Box > Form Controls.

    Combo in Excel - step 6

  3. Then, we must select the “Combo Box” to draw in the worksheet.

    Combo in Excel - step 7

  4. Now, right-click on the combo box and go to “Format Control.”

    Combo in Excel - step 8

  5. As a result, the “Format Control” dialog box opens up. Under the “Control” option, make the following changes.

    Input Range: Range of cells that contain values that will appear in our combo box.

    Cell link: Put the cell’s address where the number of values from the list will appear. It can help us create the functions of charts based on the combo box.

    Drop Down Lines: Number of lines in combo box – it should be the number of values in a list or less.

    Combo in Excel - step 9

  6. Now, our combo box is ready.

    Combo in Excel - step 10

#2 How to Create an Active X Controls Combo Box in Excel?

This kind of Combo Box is used in VBA CodingVBA code refers to a set of instructions written by the user in the Visual Basic Applications programming language on a Visual Basic Editor (VBE) to perform a specific task.read more. It is an advanced level of the combo box. So we need a bit of VBA knowledge. Anyway, let us go ahead and learn about this type of combo box.

To add the ActiveX Control combo box, follow the below steps.

  • Step 1: On the ribbon click Developer TabEnabling the developer tab in excel can help the user perform various functions for VBA, Macros and Add-ins like importing and exporting XML, designing forms, etc. This tab is disabled by default on excel; thus, the user needs to enable it first from the options menu.read more > Insert > Combo Box > Active X Controls. Then, click on the “Design Mode.”

click Developer Tab > Insert > Combo Box > Active X Controls

  • Step 2: Then, we must draw the combo box on the worksheet.

Draw the Combo Box

  • Step 3: Next, we must right-click on the combo box and select “Properties.”

Right-click on the combo box and select properties

  • Step 4: In this properties window, we can see all the properties associated with this combo box. We can change the name, size, font style, font color drop-down list, etc.

Combo in Excel - step 14

  • Step 5: We need to change the combo box’s name.

Change the name of the combo box

  • Step 6: Also, we must change the font type and size.

Change the font type and size

  • Step 7: Next, select the number of rows.

Select the number of rows

  • Step 8: Select “MatchEntry” mode.

Match Entry mode on

  • Step 9: Then, give a link to the cell. So whatever the value we select from the drop-down will reflect in that cell as a value. In this example, the cell is E8.

properties window

  • Step 10: Exit from the “Properties” window and exit the “Design Mode.” That means the design of this combo box is completed. If we again want to redesign, we must click on this “Design Mode.”

Combo in Excel - step 20

Recommended Articles

This article is a guide to Combo Box in Excel. We discuss about how to create Form Control Combo Box and Active X Control Combo Box in Excel VBA with examples. You may also look at these useful functions in Excel: –

  • Recording Macros
  • Checkbox in Excel
  • List Box in VBA
  • Formatting in Excel
  • YEARFRAC in Excel

Combo Box in Excel

Table of Contents

  • Combo Box in Excel
  • How to Create Combo Box in Excel?
  • Form Controls “Combo Box” in Excel
  • ActiveX Control Combo Box in Excel
  • Steps to delete Active X Control Combo Box in Excel

Combo Box in Excel

Combo Boxes in excel is not used for VBA Code but also for Excel spreadsheets. It is available under the Insert option of the Developer menu tab. These boxes are drop-down kind of elements that allow the user to select any value from the values listed in the Combo Box drop-down list. To select the Combo box option from Insert drop down and drop it anywhere in the sheet. And to add the values into the list, click right and select Format Control, select the input range and cell link.

There are two options for creating a “Combo Box” in Excel:

  1. Form Controls “Combo Box”:- It comes inbuilt with excel. In this type of control box, users cannot make changes to properties.
  2. ActiveX Controls “Combo Box”: – It is more versatile than form control. In this type of control box, a user can make changes to properties.

Combo Box

An example used for the two methods

In order to distinguish between the two combo boxes, let us look at the following examples –

Combo Box Example

Difference between Form and Active X Combo Box

How to Create Combo Box in Excel?

Initial steps before creating a Combo Box in Excel

You can download this Combo Box Excel Template here – Combo Box Excel Template

In case the Developer tab is visible beside the View tab in the Excel Ribbon then,

  • Click on Developer-> Insert-> select “Combo Box” from either Form Controls or ActiveX Controls options.

Creating Combo Box

In case the Developer tab is not visible beside the View tab in the Excel Ribbon then,

  • Click on File -> Options.

Click Options Step 1

  • “Excel Options” dialogue box will be displayed as shown below. Click “Customize Ribbon”. Under the Customize the Ribbon” drop-down box, select the “Main Tabs” value, selected by default, on the right panel. In the “Main Tabs” panel, select the Developer check box. Click Ok.

Customize Ribbon Step 2

  • You should now find the Developer tab in your Excel Ribbon.

Developer tab Step 3

  • Create a simple list of values in the worksheet to start with, irrespective of the type of “Control Box”.

list of values

Form Controls “Combo Box” in Excel

Steps to create:

  • Go to the Developer tab in the Excel Ribbon -> click Insert -> click on “Combo Box” under “Form Controls”.

Combo Box Example 1-1

  • Click on the Excel Sheet at a location where you want to place the “Combo Box”. You may select the “Combo Box” and drag any of the small squares in the middle of the boundaries or circles in the corners to change the “Combo Box” size.

Combo Box Example 1-2

  • Right, click on the new “Combo Box” -> select “Format Control”. The “Format Control” dialog box will appear.

Combo Box Example 1-3

  • Select Control

Combo Box Example 1-4

  • Click on the button to the right of the “Input range”.

Combo Box Example 1-5

  • Select the cell range for the values in the list, which auto-populates the input box. Click on the highlighted button.

Combo Box Example 1-6

  • Click OK in the “Format Object” dialog box.

Format Object Example 1-7

Note: Drop down lines =8(by default) can be configured to show a number of items in the “Combo Box”.

Combo Box Example 1-8

  • It Shows 8 number of items in the dropdown list.

Combo Box Example 1-9

Cell link – Enter cell number to display the position of a selected value in the list.

Combo Box Example 1-10

  • It shows the position of months.

Combo Box Example 1-11

  • Now you will be able to click on the drop-down arrow of the new “Combo Box” to see the list.

Combo Box Example 1-12

Steps to delete Form Controls “Combo Box” in Excel

  • Go to Developer tab -> “Design Mode.”

Combo Box Example 1-13

  • Select the Form Controls “Combo Box” and press Delete.

Combo Box Example 1-14

Point to be remembered

  1. It helps the user to choose a value from the range of items.
  2. In Form Control Combo Box, a user cannot make changes in the properties.

ActiveX Control Combo Box in Excel

The procedure to create ActiveX Control “Combo box” is a bit different from that of Form Control “Combo Box”.

Steps to create ActiveX Control Combo Box in Excel

  1. Follow either of the 2 ways to view the “New Name” dialog box –
  • Go to Formula tab -> click on “Name Manager” -> Click New in the “Name Manager” dialog box.

Name Manager Example 2

OR

  • Go to Formula tab -> click “Define Name”.

Define Name Example 2-1

  • Enter Name, Months. Click on the button to the right of the “Refer to” input box.

Combo Box Example 2-2

  • Select the cell range which auto-populates the “Refers to” input box. Click on the highlighted button.

Combo Box Example 2-3

  • Click OK in the restored “New Name” dialogue box.

New Name dialogue box Example 2-4

  • You will find a new range by the name”Months” in the “Name Manager” list.

Combo Box Example 2-5

  • To create the “Combo Box”, we need to select “Combo Box” under “ActiveX Controls”.

Combo Box Example 2-6

  • Click on the Excel Sheet at a location where you want the “Combo Box” to be placed. Right, click on the “Combo Box” -> click on Properties.

click on Properties Example 2-7

  • A properties dialog box will appear.

Combo Box Example 2-8

  • In the Properties dialog box, in the ListFillRange field, type the name of the named range, e.g. Months, that we have created above. Click on X in the upper right corner of the dialog box to close the same.

Combo Box Example 2-9

  • Save the file with the “.xlsm” extension and reopen the file.

Combo Box Example 2-10

  • Click on a pointer in “Combo Box” to see the list of values.

Combo Box Example 2-11

  • To edit various properties, e.g. font size, color etc., make changes through a Properties dialog box.

Properties dialog box Example 2-12

To select/deselect “Combo Box”, click on “Design Mode” in the controls group of the Developer.

  • To deselect “Combo Box”, deselect “Design Mode”.

Combo Box Example 2-13

  • To select “Combo Box”, select “Design Mode”.

Combo Box Example 2-14

  • Select “Combo Box” as shown in the following.

Combo Box Example 2-15

Steps to delete Active X Control Combo Box in Excel

  • Go to the Developer tab, turn on “Design mode”.

Design mode Example 2-16

  • Select the Active X control combo box that you want to delete and press Delete.

Combo Box Example 2-17

Things to Remember

  • It is more versatile.
  • It allows the user to type the value in the text box from the range of items.
  • In ActiveX Control “Combo Box”, the user can edit properties, e.g. font size, colors, etc.
  • It is commonly used as a user interface control where users can select an item as per their own choice.
  • It makes data entry easier and has many features and flexibility.

Recommended Articles

This is a guide to Combo Box in Excel. Here we discuss its uses and how to create Combo Box in Excel with excel examples and downloadable excel templates. You may also look at these useful functions in excel –

  1. Box Plot in Excel
  2. Combo Chart in Excel
  3. Name Box in Excel
  4. Excel Search Box

Понравилась статья? Поделить с друзьями:
  • Excel combining cell text
  • Excel combine cells as text
  • Excel com сохранить файл
  • Excel columns number to letter
  • Excel columns names as numbers