Filter Table / List Box

  • Thread starter Thread starter sosteffo
  • Start date Start date
S

sosteffo

I have a list Box at present with relivant options, but when i select a
option i want to make an amendment to the filter..?

i.e

List box has
"Red" & "Blue"

When i select Blue, i want the filter to say Equals= blue in the data.

Is this at all possible / another way around the prob

Thank
 
If the Listbox is from the Control toolbox, use its Click event to
filter the list. The following code assumes that the list starts in cell
A1, and the AutoFilter is in place (Data>Filter>AutoFilter). Column D is
filtered for the selection in the listbox:

Private Sub ListBox1_Click()
Range("A1").AutoFilter Field:=4, _
Criteria1:=ListBox1.Value
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top