How to copy the values in entire column after filter is applied

Copper Contributor

In a particular column, I need to filter for value and copy entire visible values in the column and paste it in another sheet.

I have used below code however it does not work when I have only one line excluding filter post I filter the data.

 

Worksheets("Sheet1").UsedRange.AutoFilter Field:=6, Criteria1:=Worksheets("Sheet2").Range("A" & i).Value
      Range("S1").Select
    Range("S2", Cells(Rows.Count, "S").End(xlUp)).SpecialCells(xlCellTypeVisible).Cells(1, 1).Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Copy

Regards,

Chandrakanth.K 

1 Reply

Hello @Chandrakanth K,

 

There is a video on Excel VBA Training Online that has complete VBA code to copy auto filtered data to another worksheet (http://www.exceltrainingvideos.com/copy-auto-filtered-data-to-another-worksheet-automatically-with-v...).

 

I hope this helps!