Excel:  How to apply Drop-Down Lists associated with Fields in a Data Form automatically created from a Data Table

Posted on 2015-02-08
Last Modified: 2016-02-11
Using:  Excel 2011 ver 14.4.7

I use a Data Table which has drop-down lists in many of the fields (columns).

When I automatically create (show) a Data Form in Excel 2011 from this Data Table , and try to use this form to create a new record, all of the correct fields are shown on the form but they are all blank user input fields.

How can I get the features which apply to the fields in the Data Table (for example a Drop-Down List), to get reflected in the Data Form?

Please see attached example.
Question by:qeng
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
LVL 11

Assisted Solution

Wilder1626 earned 300 total points
ID: 40597142
Have a look at my drop down sample in attachment.

If you create a range for your drop down menu and call it dbase

You can use it for your drop down menu in your cell, and also for your ComboBox in your form.

 Name Manager
drop down sampleYou can do it this way by calling your name range.
Me.ComboBox1.RowSource = "dbase"

Open in new window

LVL 11

Assisted Solution

Wilder1626 earned 300 total points
ID: 40597170
If you did not created a Dynamic drop down list, it would be a good thing to do also. So if you add items in your drop down list column, the drop down list will auto adjust, same for your ComboBox on your form.

You would then need to use below code if for example, your data base is in column A:


Open in new window

Dynamic drop down listDrop-down-list-on-VBA-form.xlsm

Author Comment

ID: 40597241
Thanks Wilder, this seems very promising.

However, I'm wondering if my problem isn't specifically related to Excel 2011 (which I have to use since that is the version used by the user for whom i'm developing this).

I can't use the Show Form function in your example spreadsheet in Excel 2011.  The spreadsheet has to be opened in read-only mode and the show form function (even with all options enabled) is inactive.

I can open it in Excel 2007 (on the Windows side of my Mac) and run the form no problem.

Also, all of the drop down lists in my Data Table are named ranges.  So, for example, the drop down list in the Field:  Date uses a named ranged called 'Date_List' and I make use of that named range when I create the drop-down list in the first cell of the field by inserting the list name '=Date_List' through the Data Validation command.

What doesn't seem to happen in Excel 2011 though is if I use from the ribbon:  Data > Form, in the form which shows up, none of the fields have drop down lists.  The form shows all the correct values for a particular record in the Data Table but unlike the cell from which this data originates (which has a drop down cell in it), none of the fields in the Data Form shows any dropdown lists.  They just show up as a cell with data in it.

This means that my user would be guessing when they are entering data via the Data Form as to what values are appropriate for that field, unlike if they were entering the same data directly into the Data Table if I copied a row, deleted the entries and then let the user visit each cell and use the dropdown lists.
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 11

Assisted Solution

Wilder1626 earned 300 total points
ID: 40597277
Sorry, i don't have a Mac to test it, but it should not be to complicated to adjust.

Can you tell me if this macro file working on Excel 2011 for Mac? Please validate the drop down menu.
LVL 18

Assisted Solution

Simon earned 200 total points
ID: 40597792
I don't think that dropdowns are a feature of the builtin 'form' view of lists in Excel 2011 that appears when you use Data/Form... menu. The field entry is validated by the rule that you specify but no dropdown is shown.
Wilder showed you custom-made user-form in his post above, which is not the same thing.

Author Comment

ID: 40598082
Simon is correct (Wilder, again, thank you for the code).

What I was hoping for, short of setting some configuration parameter which would automatically bring the Data Table validation features like lists into the Data Form, was some way of starting with the Data Form which is automatically generated by Excel 2011 (similar to a 'View Code' function) and then just adding the validation features one by one, then saving the form.  This would have saved me having to custom build the entire form from scratch (I'm not familiar enough with VBA to do this yet but getting there).

Do either of you know if there is a way to see and save the Excel Data Form code to use as a starting point?  Or some other way around this?
LVL 18

Accepted Solution

Simon earned 200 total points
ID: 40598170
>Do either of you know if there is a way to see and save the Excel Data Form code to use as a starting point?  Or some other way around this?

I am 99.999% sure that there is no way to get access to the Excel Data Form code, as it is built-in, rather than being part of an add-in. It also looks like it is a deprecated feature, as it no longer appears on the standard ribbons/toolbars of most recent versions.

I'd think your only option is to build a userform, or use another application (such as MS Access) for the data-entry.

Author Closing Comment

ID: 40602869
Thanks for staying with me on this guys.  I will try building the user form.

Do either of you know if I can re-use part of the user form VBA code which Excel 2011 automatically generates with the Data > Form command (it would save a lot of work from having to create the entire form from scratch).  I would just need to add the drop-down list capabilities to that code.

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel Macro - loop 4 12
Excel printing an invoice header over two sheets 3 30
Troubleshooting Save_Record_Click() VBA 6 23
run FileCopy code from a string 6 22
We could spend the next millennium discussing the differences of the Mac and Windows platforms. The next century will continue to have fanatics on both side of the equation and neither side will win the war. However, that’s not why we are here. W…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question