Results 1 to 6 of 6

copy & paste last 10 visible values

Threaded View

  1. #1
    Registered User
    Join Date
    09-22-2015
    Location
    India
    MS-Off Ver
    MS office 10
    Posts
    15

    copy & paste last 10 visible values

    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.
    Last edited by Meena_Sassati; 01-13-2016 at 09:24 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Copy Visible cells and paste values only to visible target cells
    By wotadude in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-20-2024, 12:01 AM
  2. Copy & Paste visible cells only
    By klopatios in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 05-06-2013, 03:59 AM
  3. How to copy/paste only what is visible
    By nenadmail in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-08-2012, 02:49 PM
  4. Use visible rows from autofilter to build Pivot table. Or use visible rows to Copy/Paste
    By mwhitedesigns in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-08-2012, 10:34 AM
  5. Copy and paste visible to different sheet
    By cabinetguy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-04-2011, 03:04 PM
  6. copy and paste visible columns
    By ferde in forum Excel General
    Replies: 1
    Last Post: 12-08-2005, 04:55 AM
  7. Copy paste visible on same sheet
    By Jay in forum Excel General
    Replies: 1
    Last Post: 09-26-2005, 12:05 PM
  8. Copy & Paste visible cells only
    By Scott in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-23-2005, 12:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1