98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Filtering issues when used with a form
Filtering issues when used with a form
Resolved · Medium Priority · Version 2010
Nick has attended:
Excel VBA Intro Intermediate course
Filtering issues when used with a form
I am trying to create a form that pulls out the lines of information relating to the data that is put into it from the combobox list.
It is working fine when the fields match with something in the list; however, when I want to show all and run the report it keeps filtering everything out rather than leave everything in.
I have set the variables up as public and they match the data in the spreadsheet.
when the variable = "All" I have put in the following code
if Locality = "All" then
ActiveSheet.Range("$A$4:$UO$475").AutoFilter field:=FieldNum
end if
When the line of code is done in isolation or recorded as a macro it makes the autofilter show all but when run as part of the code it unselects everything.
It seems to be having issue with the "All" as it is not on the list of possible choices in the spreadsheet but is an option for the combobox.
Please help me!
I just need a default setting that will allow thye report to run with all data showing if "all" is selected.
Also bear in mind that there are 2 comboboxes and each can be either selected as specific variables or as "All" or a combination of both relating to 2 different fileds.
Thanks
RE: Filtering issues when used with a form
Hi Nick,
Thanks for the forum question.
I will need to have a look at all the code to say what you need to do. Please send the workbook to:
info@stl-training.co.uk
Please add my name in the subject.
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Line breaks in a cellYou can control the line breaks for multiple-line headings or labels in your Microsoft Excel worksheet, just like you do in Microsoft Word. Here's how to do it. |