We help IT Professionals succeed at work.

Ignore blanks in Dropdown list from form control

zerog
zerog asked
on
1,240 Views
Last Modified: 2014-11-14
I'm using a dropdown list from the form control and populating it with a named range which gets its data from

=MarkEntry!$A$7:$A$108

The range accommodates about a 100 students, sometimes there are less, but the last row is always needed in the dropdown, because it has the class average. How would I ignore the blank lines when populating the dropdown.
Comment
Watch Question

gowflowPartner
CERTIFIED EXPERT

Commented:
Several ways

1) A small VBA can do this eliminating blanks to fill the dropdown
2) A VBA to sort the data and only capture data except blanks

Your choice
gowflow
gowflowPartner
CERTIFIED EXPERT

Commented:
You also may want to look at this link

http://www.cpearson.com/Excel/noblanks.htm

gowflow

Author

Commented:
My knowledge with VBA scripting is limited ... any samples or leads that can assist?
gowflowPartner
CERTIFIED EXPERT

Commented:
Sure no sweat just post your sample workbook so this way the solution will be adapted exactly to your need.
gowflow

Author

Commented:
Thank you. See the second dropdown list on the "IndividualGraph" sheet.
Graphs.xlsx
gowflowPartner
CERTIFIED EXPERT

Commented:
ok here it is I created in sheet in Col BA7 and down the following formula as Array (CTRL,SHIFT,ENTER) and I called this new Range NoBlankCell
=IFERROR(INDEX($A$7:$A$108,SMALL((IF(LEN($A$7:$A$108),ROW(INDIRECT("1:"&ROWS($A$7:$A$108))))),ROW(A1)),1),"")

Open in new window


Then I modified your Range Name to be as follows:
=OFFSET(NoBlankCell,,,COUNTA(NoBlankCell)-COUNTBLANK(NoBlankCell))

Open in new window


Now check if this is what you want. I deliberately created stupid names as you can see in different rows to make sure it is working properly.

NOTE
I have to thank you for your question as I am not a 'Formula' Guy but rather a VBA one but seems the challenge and your extensive use of Named Ranges got me to fix it this way.

Regards
gowflow
Graphs.xlsx

Author

Commented:
Thanks gowflow for your solution. The dropdown works as I wanted. I just notice that the class average no longer plots on the graph. I get a #VALUE!
Must be something to do with the referencing. I'm just wondering would a VBA solution avoid that from happening?
gowflowPartner
CERTIFIED EXPERT

Commented:
Wait Wait.

What is the Class average ? In what sheet ??? If in IndividualGraph the file you posted did not have the Average !!! In Summary the Average is there.

Pllsadvise
gowflow

Author

Commented:
Below the graph on the "IndividualGraph" sheet there's a table that displays the data for the selection from the dropdown lists. If you choose class average from the second dropdown the table no longer populates.
gowflowPartner
CERTIFIED EXPERT

Commented:
I see what you mean let me look at it and will revert.
gowflow
Partner
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Perfect. Thank you for all your help
gowflowPartner
CERTIFIED EXPERT

Commented:
Your welcome, a small comment I did not understand why the first combo does not populate all the names !
gowflow

Author

Commented:
The first dropdown excludes the Class Average from the name list and the second dropdown includes the Class Average from the name list. It was just a quick workaround to avoid Class Average being compared to Class Average on the graph
gowflowPartner
CERTIFIED EXPERT

Commented:
Ah Ic.
If you need more help pls do not hesitate to put a link to any question you may have in here.

Regards
gowflow

Author

Commented:
Thank you. Much appreciated
gowflowPartner
CERTIFIED EXPERT

Commented:
Your welcome

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.