Solved

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
8
314 Views
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.
Data-Form-No-DropDown.jpg
0
Comment
Question by:qeng
  • 3
  • 3
  • 2
8 Comments
 
LVL 11

Assisted Solution

by:Wilder1626
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.
Ex:
Me.ComboBox1.RowSource = "dbase"

Open in new window

Drop-down-list-on-VBA-form.xlsm
0
 
LVL 11

Assisted Solution

by:Wilder1626
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:

=OFFSET(Sheet1!$A$2,0,0,COUNTA(Sheet1!$A:$A)-1,1)

Open in new window


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

Author Comment

by:qeng
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.
0
 
LVL 11

Assisted Solution

by:Wilder1626
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.
Drop-down-list-on-VBA-form-mac.xlsm
0
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 
LVL 18

Assisted Solution

by:SimonAdept
SimonAdept 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.
0
 

Author Comment

by:qeng
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?
0
 
LVL 18

Accepted Solution

by:
SimonAdept 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.
0
 

Author Closing Comment

by:qeng
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.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now