hello friends
I want to copy last 10 visible values of column A. i have below macro, can anyone help me.
Sub Filter_Copy_Paste()
' filter coulmn "A"
With Sheets("EOD")
.Range("A1:B30000").AutoFilter field:=1, Criteria1:=Sheets("System").Range("C2").Value
End With
' Copy only visible rows to another sheets on same workbook
Dim src As Worksheet
Dim tgt As Worksheet
Dim filterRange As Range
Dim copyRange As Range
Dim lastRow As Long
Set src = ThisWorkbook.Sheets("EOD")
Set tgt = ThisWorkbook.Sheets("System")
lastRow = src.Range("B" & src.Rows.Count).End(xlUp).Row
Set filterRange = src.Range("B2:B" & lastRow)
Set copyRange = src.Range("B2:B" & lastRow)
copyRange.SpecialCells(xlCellTypeVisible).Copy tgt.Range("B7")
Set filterRange = src.Range("F2:F" & lastRow)
Set copyRange = src.Range("F2:F" & lastRow)
copyRange.SpecialCells(xlCellTypeVisible).Copy tgt.Range("C7")
End Sub
Thanks in advance.
Bookmarks