filtering a listbox

Rasberry

Board Regular
Joined
Aug 11, 2002
Messages
201
Office Version
  1. 365
I can't figure out what I am doing wrong. I have a listbox created, but I want to specify only certain records in that listbox based on a field. I tried applyfilter, but I guess I am applying it wrong.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
If the listbox is based on a query, then you would filter the query. If it is a value list, then I know of know way to filter it except to limit the items that you are adding.
 
Upvote 0
The listbox is based on a table. I had a macro that opened the table, then applied the filter and it worked, but I can't get it to change the listbox.
 
Upvote 0
An approach:
Use a query as the Rowsource of the listbox, adjust the query as necessary (your filter criteria) then requery the listbox.
 
Upvote 0
Ok, first, you probably want to create a query and filter waht you need through the query as opposed to running it directly off of the table.

And not knowing your other code, a little Me.Repaint in VBA after the query runs never hurts.
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,337
Members
452,907
Latest member
Roland Deschain

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top