Filter

U

uplink600

Hi

I have a list of products (approx 27000 rows) with a lot of items
duplicated depending on where the stock is located. I want to filter
the list to show only selected products and to do this I would like the
user to enter the product code in an input dialog box and for the
filtered rows to appear as normal (as if autofilter had been used).

I would prefer this method as opposed to using the autofilter as there
are too many product codes to scroll through to find the required
code.

Can you please advise the best way to acheive this.

Thanks

VC
 
K

Ken Johnson

VC,
this worked for me when numbers are in column A and the autofilter is
already in place

Option Explicit
Sub FilterInputBox()
Dim Productnumber As String
Productnumber = Application.InputBox( _
prompt:="Enter the Product Number", _
Type:=2)
Range("A1").AutoFilter Field:=1, Criteria1:=Productnumber
End Sub

Hope this is useful.
Ken Johnson
 

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

Top