Below is an example of code for copying the filtered visible data and pasting to another worksheet.
Explanation of code between the asterisk lines. (The asterisk lines are prefixed with a single quote, so they are comments only)
Firstly: When you copy and paste the code, this section will probably have blank lines between the typed lines. Remove the blank lines or the code will error because the space and underscore at the end of the lines are actually line breaks in an otherwise single line of code and the code cannot have blank lines between such lines after line breaks.
Actual code explanation:
With wsSource is the source data workheet containing the filtered data.
With .AutoFilter.Range is the entire AutoFiltered range. (Includes column headers plus visible and non-visible data)
.Offset(1, 0) moves the range down one row off the column headers but adds an additional blank row at bottom.
.Resize(.Rows.Count - 1, .Columns.Count) This resizes by deleting the additional line added by previous Offset command.
.SpecialCells(xlCellTypeVisible) is self-explanatory (Only includes visible data)
Sub CopyPastFiltData()
Dim wsSource As Worksheet
Dim wsDestin As Worksheet
Dim rngVisible As Range
Dim rngDestin As Range
Set wsSource = Worksheets("Sheet1") 'Edit "Sheet1" to your worksheet name
Set wsDestin = Worksheets("Sheet2") 'Edit "Sheet2" to your worksheet name
'\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
With wsSource
With .AutoFilter.Range
Set rngVisible = .Offset(1, 0) \_
.Resize(.Rows.Count - 1, .Columns.Count) \_
.SpecialCells(xlCellTypeVisible)
End With
End With
'\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
'Assign first cell of destination to a range variable
With wsDestin
Set rngDestin = .Cells(.Rows.Count, "A").End(xlUp).Offset(1, 0) 'Next blank row in destination sheet
If rngDestin.Row > 1 Then 'Not first row of worksheet with column headers
'Copy the visible data and Paste to the Destination worksheet
rngVisible.Copy Destination:=rngDestin
End If
End With
End Sub