Copy and paste filtered data

ZaneCOYS

New Member
Joined
Nov 23, 2010
Messages
24
Hi,

I am looking to copy data from one worksheets to another. I will be filtering on column "U" using an array to show the 'to be filtered by' data. The code I have for this is:

For d = 1 To 21
Worksheets("Raw Data wo ACT").Activate
Range("U1").Select
Selection.AutoFilter Field:=21, Criteria1:=data_info(d, 1)

Next d

I now need to Copy the filtered data from Columns E,F,H,R,S,T. and paste to another worksheet. To make this more complex the destination of the paste is diferent for each filter.

please help as I seem to be going around in circles.
 
Last edited:

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Something along these lines:
Code:
Dim LR As Long
Dim wsDest As Worksheet

Set wsDest = Sheets("Report")

With Worksheets("Raw Data wo ACT")
    .AutoFilterMode = False
    .Rows(1).AutoFilter

    For d = 1 To 21
        .Rows(1).AutoFilter Field:=21, Criteria1:=data_info(d, 1)
        LR = .Range("U" & .Rows.Count).End(xlUp).Row
        If LR > 1 Then _
            .Range("E2:F" & LR & _
                  ",H2:H" & LR & _
                  ",R2:T" & LR).Copy _
                wsDest.Range("A" & Rows.Count).End(xlUp).Offset(1)
    Next d

    .AutoFilterMode = False
End With
 
Upvote 0

Forum statistics

Threads
1,216,178
Messages
6,129,325
Members
449,501
Latest member
Amriddin

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