ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   another filtering question (https://www.excelbanter.com/excel-programming/443136-another-filtering-question.html)

Bradly

another filtering question
 
I was assisted with the following code, which filters two pieces of data--a
case manager ID (###A from column B) and a program code (MA from column C):

Sheets("Office").Activate
Application.ScreenUpdating = False
With Sheets("Office")
.Activate
.Range("A1").Select
.Range("B1:C1000").AutoFilter Field:=1, Criteria1:="115A"
.Range("B1:C1000").AutoFilter Field:=2, Criteria1:="MA"
.Range("A1:M" & Cells(Rows.Count, "A").End(xlUp).Row).SpecialCells( _
xlCellTypeVisible).Copy Destination:=Worksheets("115A").Range("A3")
.AutoFilterMode = False
End With


Sheets("115A").Activate
Application.Goto Reference:="R1C1"
Application.ScreenUpdating = True

Is there any way to filter additional data in different columns? I wanted
to ask if it was possible to modify the above code to also filter 3rd and 4th
pieces of data (program types "F" and "P", both in column D).

Thanks.


Don Guillett[_3_]

another filtering question
 
Just record a macro while doing so you can see what is happening and then
modify existing macro.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Bradly" wrote in message
...
I was assisted with the following code, which filters two pieces of data--a
case manager ID (###A from column B) and a program code (MA from column
C):

Sheets("Office").Activate
Application.ScreenUpdating = False
With Sheets("Office")
.Activate
.Range("A1").Select
.Range("B1:C1000").AutoFilter Field:=1, Criteria1:="115A"
.Range("B1:C1000").AutoFilter Field:=2, Criteria1:="MA"
.Range("A1:M" & Cells(Rows.Count, "A").End(xlUp).Row).SpecialCells( _
xlCellTypeVisible).Copy Destination:=Worksheets("115A").Range("A3")
.AutoFilterMode = False
End With


Sheets("115A").Activate
Application.Goto Reference:="R1C1"
Application.ScreenUpdating = True

Is there any way to filter additional data in different columns? I wanted
to ask if it was possible to modify the above code to also filter 3rd and
4th
pieces of data (program types "F" and "P", both in column D).

Thanks.




All times are GMT +1. The time now is 09:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com