ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel

How to Use, Create and Configure Form Controls List Boxes in Excel 2007 and Excel 2010

Updated on February 10, 2013

Introduction

Hi and welcome to my latest in the series on Form and ActiveX Controls in Excel 2007 and Excel 2010. Today, we will investigate the List Box. As the name suggests, the List Box allows you to create a box containing a list from which the user can select either one or any number of items.

List Boxes are very similar to Combo boxes, however:

  • Combo boxes display the items in drop down list, whereas
  • List Boxes display all the items at once provided there is sufficient space to display them
  • Combo boxes are preferable when real estate on the worksheet is an issue
  • If you want to display the entire list for the user to see a List box would be more appropriate
  • Also, if you want the user to be able to select a number of items from the list provided, you should use an ActiveX List Box

The figure below shows the difference between ActiveX and Form Controls List Boxes and also Combo Boxes. From left to right the figure shows:

  • Form Controls List Box
  • ActiveX Controls List Box where a user can select only one item
  • ActiveX Controls List Box where a user can select any number of items
  • A Combo Box

Examples of Form Control (far left) and ActiveX List Boxes (middle) compared with Combo Boxes (right) all created using Excel 2007 and Excel 2010.
Examples of Form Control (far left) and ActiveX List Boxes (middle) compared with Combo Boxes (right) all created using Excel 2007 and Excel 2010. | Source

I have a hub that goes into creating and configuring both Form Controls and ActiveX Controls Combo Boxes in Excel 2007 and Excel 2010 in far greater detail. This hub can be found here:

http://robbiecwilson.hubpages.com/hub/Configuring-and-Using-Combo-boxes-in-Excel-2007

As with the majority of Excel’s Controls, they are available in two types; Form Controls and ActiveX Controls. Form Controls are much simpler to create, ActiveX Controls are more advanced are more configurable and can also have Visual Basic code assigned to it.

Note: If you need to create a list where a user can select more than one item from the list, you should use an ActiveX List Box.

In part one of this two part hub, I will look at using Form Controls to create simple List Boxes, in part two I will look at creating more complex List Boxes using ActiveX Controls. That hub can be found here:

http://robbiecwilson.hubpages.com/hub/Using-creating-and-configuring-ActiveX-Controls-List-Boxes-in-Excel-2007-and-Excel-2010

In this hub, we will be creating a panel where users of our workbook can select the music they wish to buy. The final result will look similar to mine below.

Example of List Boxes created using Excel 2007 and Excel 2010.
Example of List Boxes created using Excel 2007 and Excel 2010. | Source

Creating a Form Controls List Boxes in Excel 2007 and Excel 2010

To begin, we need to ensure that the Developer tab is present in Excel. To add this tab in Excel 2007 should it be absent:

  • Click the Excel button
  • Select Excel Options
  • While on the Popular tab, select Show Develop tab in the Ribbon

Adding the Developer tab in Excel 2007.
Adding the Developer tab in Excel 2007. | Source

For Excel 2010, the process of adding the Developer tab is a little different:

  • Select the File menu
  • Then click Options
  • On the Customise Ribbon tab, select Developer as shown below

Adding the Developer tab to Excel 2010.
Adding the Developer tab to Excel 2010. | Source

Before creating the List Box, we need to create the items that the List Box will list. Simply type them into a column one item per cell.

Note: You may wish to hide the column once you have created the List Box to ensure that they are not changed or the cells deleted.

Note: Unless advised otherwise, the process for creating List Boxes in Excel 2010 is identical to Excel 200.

Now we create the List Box itself:

  • Click on the Insert button which is in the Controls group on the Developer tab
  • Select List Box from the Forms Controls section
  • The cursor will change to a +
  • Draw the outline of your List Box
  • This will create a blank List Box as shown below

Blank List Box created using Excel 2007 and Excel 2010.
Blank List Box created using Excel 2007 and Excel 2010. | Source

Configuring the Form Controls List Box in Excel 2007 and Excel 2010

To configure the List Box, right click on it and select Format Control

  • On the Size tab, you can precisely resize your List Box
  • On the Control tab, the Input Range is the list of items you want displayed in your List Box
  • Cell Link is the cell you want the item that the user selected to be displayed in
  • Selection Type has to be Single (if you want Multi or Extend, you should create an ActiveX Controls List Box)
  • 3-D Shading adds 3-D shading to your List Box
  • Click OK and your List Box will be configured

Configurable options for Format Controls List Boxes in Excel 2007 and Excel 2010.
Configurable options for Format Controls List Boxes in Excel 2007 and Excel 2010. | Source

When we select an item in the List Box Excel returns a number (e.g. if I select Billy Joel, Excel puts 5 in R3). This is because Billy Joel is the fifth entry in the list. We need to convert this into a more useful result so that when a user clicks Billy Joel, Excel 2007 (or Excel 2010) puts “Billy Joel” into a cell. To do this, we will use an IF command

=IF(R3=5,"Billy Joel")

As we have more than one in the list, we need to have an IF statement for each of the artists available as shown below for the first three items.

=IF(R3=1,"Pink Floyd",IF(R3=2,"Bruce Springsteen",IF(R3=3,"R.E.M.")))

Now we create List Boxes and IF statements for the music format and quantity until we have the following:

Finished List Boxes for our music shop, created using Excel 2007 and Excel 2010.
Finished List Boxes for our music shop, created using Excel 2007 and Excel 2010. | Source

The formula to convert our media List Boxes output to more useful text is:

=IF(R4=1,"CD",IF(R4=2,"LP",IF(R4=3,"DVD",IF(R4=4,"Cassette"))))

The Quantity List box does not need an IF statement as the List Box returns the same number as the quantity selected.

Now we have to tie it all together to create our final panel that will display all our list boxes and the output of the user’s selection.

Our List Boxes utilise the data in the box in the figure below for our lists (O5:O23) and their output is placed into R3:R5. The IF statements that convert these numbers to text are held in U12 and U13

Results of user selections from the List Boxes converted using IF statements in Excel 2007 and Excel 2010.
Results of user selections from the List Boxes converted using IF statements in Excel 2007 and Excel 2010.

Now we need to create the text that will go at the bottom of the panel of List Boxes to tell the user in text what they have selected.

Firstly, we use another IF statement.

=IF(R5=1,"One copy of",IF(R5=2,"Two copies of"))

This converts 1 to One copy of and 2 to Two copies of etc.

Finally, we need to join our two text cells together. To achieve this we use the CONCATENATE function.

=CONCATENATE(U13, " on ",U12)

This tells Excel to join U13 to U12 and to add “ on “ in the middle.

I have a hub that investigates the CONCATENATE function in more detail which can be found here:

http://robbiecwilson.hubpages.com/hub/Using-the-CONCATENATE-LEFT-RIGHT-and-MID-functions-in-Excel-2007

The final result of our list boxes and the formulas we have used can be seen below.

Completed Form Controls List Boxes for my music shop, created in Excel 2007 and Excel 2010.
Completed Form Controls List Boxes for my music shop, created in Excel 2007 and Excel 2010. | Source

Conclusion

Today, we have looked at using Form Controls to create List Boxes which allow users to select items from a list. We have then used a variety of functions (IF and CONCATENATE) to convert this numerical data into data that reflects what the user selected. In my example, we created a simple panel that allows users to select music they want to purchase and then displays that selection below the List Boxes.

In addition to Combo Boxes and List Boxes, I have created hubs for a number of the other Controls that Excel 2007 and Excel 2010 have available.

Using a Command Button you can create a button that performs a specific function when pressed. The function is created using Visual Basic. In my hub, I create a button that resets all my Check Boxes or Combo Boxes are reset to default. My hub on Command Buttons can be found here:

http://robbiecwilson.hubpages.com/hub/Create-a-Command-Button-in-Excel-2007

Command Button alongside the Visual Basic used to configure it created using Excel 2007 and Excel 2010.
Command Button alongside the Visual Basic used to configure it created using Excel 2007 and Excel 2010. | Source

Check boxes allow users to select or tick items in lists such as shopping lists or to-do lists. When Conditional Formatting is added to the list, not only are the Check Boxes ticked but the text can be changed to reflect whether it is completed or not. My hubs for Check Boxes and Conditional Formatting can be found here:

http://robbiecwilson.hubpages.com/hub/Configuring-and-Using-Check-boxes-in-Excel-2007

http://robbiecwilson.hubpages.com/hub/Conditional-Formatting-in-Excel-2007

Example of Check Boxes utilising Conditional Formatting in Excel 2007 and Excel 2010.
Example of Check Boxes utilising Conditional Formatting in Excel 2007 and Excel 2010. | Source


Finally, Scroll Bars and Spin Buttons allow users to quickly select numbers from a list (for example selecting their birthday or the interest rate and term of their chosen mortgage). Both Scroll Bars and Spin Buttons are very similar to buttons you see on websites and are very user friendly and easy to use.

Spin Buttons:

http://robbiecwilson.hubpages.com/hub/Creating-configuring-and-using-Form-Controls-and-ActiveX-Controls-Spin-Buttons-in-Excel-2007-and-Excel-2010

Scroll Bars:

http://robbiecwilson.hubpages.com/hub/Creating_and_configuring_Form_Controls_and_ActiveX_Controls_Scroll_Bars_in_Excel_2007_and_Excel_2010

Example of Form Controls (Top) and an ActiveX Controls Scroll Bar in Excel 2007 and Excel 2010.
Example of Form Controls (Top) and an ActiveX Controls Scroll Bar in Excel 2007 and Excel 2010. | Source
Example of Spin Buttons created in Excel 2007 and Excel 2010.
Example of Spin Buttons created in Excel 2007 and Excel 2010. | Source

Many thanks for reading, I do hope that you enjoyed this hub and found it informative and useful. Please join me in part two when we look at ActiveX Controls List Boxes. Please feel free to leave any comments you may have below.

working

This website uses cookies

As a user in the EEA, your approval is needed on a few things. To provide a better website experience, hubpages.com uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at: https://corp.maven.io/privacy-policy

Show Details
Necessary
HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
LoginThis is necessary to sign in to the HubPages Service.
Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
AkismetThis is used to detect comment spam. (Privacy Policy)
HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the googleapis.com or gstatic.com domains, for performance and efficiency reasons. (Privacy Policy)
Features
Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
MavenThis supports the Maven widget and search functionality. (Privacy Policy)
Marketing
Google AdSenseThis is an ad network. (Privacy Policy)
Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
Index ExchangeThis is an ad network. (Privacy Policy)
SovrnThis is an ad network. (Privacy Policy)
Facebook AdsThis is an ad network. (Privacy Policy)
Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
AppNexusThis is an ad network. (Privacy Policy)
OpenxThis is an ad network. (Privacy Policy)
Rubicon ProjectThis is an ad network. (Privacy Policy)
TripleLiftThis is an ad network. (Privacy Policy)
Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
Statistics
Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)
ClickscoThis is a data management platform studying reader behavior (Privacy Policy)