Recording a macro to populate table from autofilter

bubblyboo

New Member
Joined
May 24, 2011
Messages
15
Hello!

I'm new to this forum & fairly new to recording macros too. I think my answer will be quite simple, but here goes...

On sheet 1, I have included in the spreadsheet an autofilter with "Logged, Being Repaired, Awaiting Response & Completed"

On sheet 2, I want to populate a job sheet using the details from just "Logged, Being Repaired & Awaiting Response". I want it to copy all the data that this autofilter brings up.

I hope that makes sense!
BubblyBoo
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
I should have added that this is what my macro currently looks like:

JobSheet Macro

Sheets("Sheet1").Select
ActiveSheet.Range("$A$11:$L$32").AutoFilter Field:=7
Range("A12:F32").Select
Selection.Copy
Sheets("Sheet2").Select
Range("A7").Select
ActiveSheet.Paste

End Sub

So at the moment it's only pasting the information from cells A12:F32 and I want to paste all the data from the autofilter.

Thank you for any help!
 
Upvote 0
I managed to kind of sort it by doing the following:

Sheets("Sheet1").Select
ActiveSheet.Range("$A$11:$L$33").AutoFilter Field:=7, Criteria1:="Logged, Awaiting Response, Being Repaired"
Dim strRange
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste
Range("A8").Select
ActiveSheet.Paste

But something's not quite working right.

Any help is appreciated! Thank you
 
Upvote 0
Basically, I want an Autofilter VBA code to copy the filtered rows from sheet 1 to the active sheet. Does that make more sense?

My code at the moment is as follows:

Sheets("Sheet1").Select
ActiveSheet.Range("$A$11:$K$33").AutoFilter Field:=7, Criteria1:=Array( _
"Awaiting Response", "Being Repaired", "Logged"), Operator:=xlFilterValues
Dim strRange As String
Selection.Copy
Sheets("Sheet2").Select
Range("A8").Select
ActiveSheet.Paste

But it isn't quite right.

I know this is probably quite simple & I'm being really dumb, but if somebody could help I'd really appreciate it & it would save me a lot of time!

Thank you very much!
 
Upvote 0

Forum statistics

Threads
1,224,561
Messages
6,179,521
Members
452,923
Latest member
JackiG

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