VBA to select Row based on Cell Value and Filter sheet

rbone

New Member
Joined
Aug 19, 2019
Messages
20
Hello again MrExcel,
I need to filter reports where the filter Row is in a different row on each report.

The code below has the filter Row in Row 7, another report has it in Row 10, and another has it in Row 5, etc, etc..

Is there a way to have the macro search for "Call Type", select the row and set the filter to show "Abandoned" and "Incoming" only?

Code:
Rows("7:7").Select
    Selection.AutoFilter
    ActiveSheet.Range("$A$7:$S$2365").AutoFilter Field:=1, Criteria1:= _
        "=Abandoned", Operator:=xlOr, Criteria2:="=Incoming"

This code works for Report 1 but not reports 2, 3, 4, 5.....
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
I figured out the answer to my question.

Code:
Cells.Find(What:="Call Type", After:=ActiveCell, LookIn:=xlFormulas, _
        LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Activate
    ActiveCell.EntireRow.Select
    Selection.AutoFilter Field:=1, Criteria1:= _
        "=Abandoned", Operator:=xlOr, Criteria2:="=Incoming"
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,175
Members
452,615
Latest member
bogeys2birdies

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