@JCabral,
There is a challenge I am facing with the below code of populating the listbox.
This code is very much useful for populating more than 10 columns, hiding unwanted columns and setting column heads. However, it gives it gives "unspecified error (80004005)". And I think the reason is as follows.
I am using Advanced Filter method to copy part of the full data table in a new sheet, and defining that filtered range(lbRange) as the range for list box in this line .RowSource = lbRange.Address(external:=True) of the above code.
This works fine for the first instance of this code.
There are multiple combo boxes that act as filters on the user form. Every time a combobox value changes, the Advanced Filter method is applied to get a new set of range to be filled in the listbox. And I think that's where RowSource method doesn't work. I think when RowSource is used you can not change that data on worksheet during the code.
Below is the full code for the sub that gets called for every change in the various combo box value. I get error on the first two line itself - unspecified error (80004005).
ServLogTbl is the full Data Table on ServLogSheet.
I have added one more sheet called ServLogFiltSheet, to define the Advanced filter criteria range and also to give a CopyToRange as cell A4 on it.
The reason you suggested me to use the rowsource method of filling the list box was to accommodate the ColumnHeads.
Is there any other way to achieve this:
1. Get more than 10 columns & Column Heads (for listbox having horizontal scroll bar)
2. Allow repopulating of listbox based on changes in multiple combo box values - Advanced filter is the best option for me to do this.
3. The other option is to store the new range obtained from Advanced filter in an array and populate the listbox using .list = NewArray. BUT can I get the Column Heads in this case?
Bookmarks