Hi all
i have an excel table with data of invoices . What i want is to filter the data into a listbox based on a criteria in combobox . The filtered data should be rearranged as shown in the example file.
Thanks in advance
Hi all
i have an excel table with data of invoices . What i want is to filter the data into a listbox based on a criteria in combobox . The filtered data should be rearranged as shown in the example file.
Thanks in advance
Last edited by Khanzaki; 03-21-2022 at 01:26 PM.
First tip, try to generate one row for every product. Now you use 1 row for 3 products, which is not best practice at all if you want to analyze your data.
Then you can just use this code behind your combobox. Only thing you need to do, is scale your column widths.
![]()
Private Sub ComboBox1_Change() Dim i As Long With ListBox1 .List = Sheets(1).ListObjects(1).DataBodyRange.Value For i = .ListCount - 1 To 0 Step -1 If InStr(1, .List(i, 0), ComboBox1.Value, 1) = 0 Then .RemoveItem i Next End With End Sub
Hi thanks for your efforts.. Reason why i used 1 row for those 3 products is ..to get back values in userforms comboboxes and textboxes using vlookup of invoice no for the sole purpose of updating my data if needed..so in order to go with your suggestion i need a way to update my data by click of a button![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks