Advanced filter on multiple column

ceslyn

New Member
Joined
Mar 4, 2009
Messages
48
I've been looking over the net for information about filtering information in excel vba and haven't managed to find nothing that works.

My header is in row 22 with all the title
I have 23 columns wide of information starting at A23
I want to be able to choose my selection in column C5:C20 (each line is related to a title in my header row and these are all exact match) and this will filter my information when I press the button.

I've tried multiple ways and can make the auto filter work.

Unfortunately I am starting from scratch and need help. I'm sure this is a very simple task for someone that has knowledge with VBA.

Thanks in advance for your help.
 

Some videos you may like

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

ceslyn

New Member
Joined
Mar 4, 2009
Messages
48
I've managed to work with this code but it doesn't work properly.

Private Sub CommandButton3_Click()
Dim item As String
Dim rng As Range
item = Sheet1.Range("d1").Value

Set rng = Sheet1.Range("a23")
rng.AutoFilter Field:=1, Criteria1:=item
Sheet1.Select
End Sub

I keep on loosing my rows from 23 to 294 but i do get the rest to 24000.
 

Watch MrExcel Video

Forum statistics

Threads
1,114,108
Messages
5,545,986
Members
410,718
Latest member
ALM1GHTY
Top