Good morning.
I trust someone who is more VBA savvy with me can answer my query.
I have a Userform that contains multiple comboboxes, about 25 at the moment that I use to select different options to filter a table and export the results.
At the moment, I have written the code so it checks each combobox to see if the value is blank before running the actual filtering and export, and then gives a warning message, stopping the code until all boxes have a value. Now that is a lot of code, as each combobox has its own line of code, checking for blanks. Eg If CMBox1.value = "" then msgbox "You havent selected all options" exit sub end if blah blah etc... thats not actual code BTW
I have been thinking of ways to improve the code, so my question is, it is possible I can group all the comboboxes using the tag property, so that when it looks for blanks, it looks at them as a bulk. For example, If the item is a combobox and has a tag of "testing" then if any combobox value is "" then msgbox "You havent selected all options" exit sub etc.
Something along those lines, yet I havent done anything with grouping comboboxes as a group or how to actual do the code, so hoping someone on here can help?
Many thanks
Mark
I trust someone who is more VBA savvy with me can answer my query.
I have a Userform that contains multiple comboboxes, about 25 at the moment that I use to select different options to filter a table and export the results.
At the moment, I have written the code so it checks each combobox to see if the value is blank before running the actual filtering and export, and then gives a warning message, stopping the code until all boxes have a value. Now that is a lot of code, as each combobox has its own line of code, checking for blanks. Eg If CMBox1.value = "" then msgbox "You havent selected all options" exit sub end if blah blah etc... thats not actual code BTW
I have been thinking of ways to improve the code, so my question is, it is possible I can group all the comboboxes using the tag property, so that when it looks for blanks, it looks at them as a bulk. For example, If the item is a combobox and has a tag of "testing" then if any combobox value is "" then msgbox "You havent selected all options" exit sub etc.
Something along those lines, yet I havent done anything with grouping comboboxes as a group or how to actual do the code, so hoping someone on here can help?
Many thanks
Mark