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

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

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,109,380
Messages
5,528,366
Members
409,817
Latest member
JiNXX9500

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top