Selecting filter results in a Macro

scany42

New Member
Joined
Jun 4, 2013
Messages
20
I am creating a macro and I filter out data then copy and paste it to another sheet for a report. The report has a different amount of results from month to month. How do I tell the macro to select all the results no matter how many there are? Select all doesn't work because there are multiple columns. Thanks.


Excel 2010
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Range("A1:A10").Select
Selection.Copy
Sheets("Sheet2").Select
Range("A1").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Application.CutCopyMode = False
Range("B1:B10").Select
Selection.Copy
Sheets("Sheet3").Select
Range("A1").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("C8").Select
Application.CutCopyMode = False
Range("C1:C12").Select
Selection.Copy
Sheets("Sheet4").Select
Range("A1").Select
ActiveSheet.Paste
Range("B5").Select
Sheets("Sheet2").Select
Columns("A:A").Select
Application.CutCopyMode = False
Selection.AutoFilter
ActiveSheet.Range("$A$1:$A$10").AutoFilter Field:=1, Criteria1:=">=50", _
Operator:=xlAnd
Range("B7").Select
Sheets("Sheet3").Select
Columns("A:A").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$A$12").AutoFilter Field:=1, Criteria1:=">=200", _
Operator:=xlAnd, Criteria2:="<=800"
Sheets("Sheet4").Select
Columns("A:A").Select
Selection.AutoFilter
Range("A2").Select
ActiveSheet.Range("$A$1:$A$12").AutoFilter Field:=1, Criteria1:="<100", _
Operator:=xlAnd
Range("C13").Select
Sheets("Sheet2").Select
Range("A2:A10").Select
Selection.Copy
Sheets("Sheet5").Select
Range("A2").Select
ActiveSheet.Paste
Range("A7").Select
Sheets("Sheet3").Select
Range("A6:A10").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet5").Select
ActiveSheet.Paste
Sheets("Sheet4").Select
Range("A5:A12").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet5").Select
Range("A12").Select
ActiveSheet.Paste
Range("D15").Select
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,430
Messages
6,119,443
Members
448,898
Latest member
drewmorgan128

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