I have a listbox on a user form that currently lists all employees. The RowSource for the box is a named range on a hidden sheet in the template called EmpSelect. It works fine, but there are nearly 500 employees. So I’d like to be able to display only those employees in a specific office and/or with a specific job title. I can include the respective codes for those two items in the EmpSelect range, but I don’t know how to (or if I can) limit the choices displayed in the listbox based on that kind of criteria (probably selected from a combo box). I’d know how to do it in Access, and I could do it in Excel if my data were in Access, but if I leave the data in Excel, is there a way in VBA to say, “Give me all the rows in EmpSelect where Office equals 5200 and/or Title equals 358”? I tried searching for an example of someone doing this, but I didn’t even know what to search for. What I did find all had to do with Access.
I was thinking that maybe there would be a way to apply filters to the data through code and then have the named range somehow dynamically resolve to only visible cells. Or something like that.
Many thanks for a point in the right direction!
–Karyl