+ Reply to Thread
Results 1 to 4 of 4

Copy and Paste Filtered Data

Hybrid View

  1. #1
    Registered User
    Join Date
    05-29-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2010
    Posts
    8

    Copy and Paste Filtered Data

    I need to copy all the filtered data only from "Sheet1" over to "Members" currently I am just having it select and copy / paste, but this takes a great deal of time. I've looked through some forums to try and figure this out, but can't seem to locate a helpful answer, any ideas?

    This is what I currently have:

    Sheets("Sheet1").Select
            Range("A1").Select
        Selection.AutoFilter
    
        ActiveSheet.Range("$A$1:$AC$5543").AutoFilter Field:=14, Criteria1:="YES"
        Cells.Select
        Range("E1").Activate
        Selection.Copy
        Sheets("Members").Select
        Cells.Select
        ActiveSheet.Paste
        Sheets("Sheet1").Select
        ActiveSheet.Range("$A$1:$AC$5543").AutoFilter Field:=14
        Range("E2").Select
        Selection.End(xlToLeft).Select
        Application.CutCopyMode = False
    Thank you!
    Last edited by arlu1201; 10-25-2012 at 01:58 AM. Reason: Use code tags in future.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Copy and Paste Filtered Data

    Hi, r5swank,

    please use Code-Tags for displaying the contents. Maybe this is slightly faster:
    With Sheets("Sheet1")
      .Range("A1").AutoFilter
      With .Range("A1").CurrentRegion
          .AutoFilter Field:=14, Criteria1:="YES"
          .SpecialCells(xlCellTypeVisible).Copy Sheets("Members").Range("A1")
          .AutoFilter
      End With
    End With
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Copy and Paste Filtered Data

    Do either of these help any?

    Sub r5swank2()
    
    Application.ScreenUpdating = False
    
    Sheets("Sheet1").Select
    Range("A1").Select
    Selection.AutoFilter
    
    ActiveSheet.Range("$A$1:$AC$5543").AutoFilter Field:=14, Criteria1:="YES"
    Cells.Select
    Range("E1").Activate
    Selection.Copy
    Sheets("Members").Select
    Cells.Select
    ActiveSheet.Paste
    Sheets("Sheet1").Select
    ActiveSheet.Range("$A$1:$AC$5543").AutoFilter Field:=14
    Range("E2").Select
    Selection.End(xlToLeft).Select
    Application.CutCopyMode = False
    
    Application.ScreenUpdating = True
    
    End Sub
    Not sure this one does what you want so try on a copy first.

    
    Sub r5swank()
    
    Application.ScreenUpdating = False
    
    Sheets("Sheet1").Activate
    
        With Range("$A$1:$AC$5543")
        
            .AutoFilter Field:=14, Criteria1:="YES"
            .SpecialCells(xlCellTypeVisible).EntireRow.Copy Sheets("Members").Range("A" & Rows.Count).End(3)(2)
            
        End With
        
    ActiveSheet.AutoFilterMode = False
    
    Application.ScreenUpdating = True
    
    
    End Sub

  4. #4
    Registered User
    Join Date
    05-29-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Copy and Paste Filtered Data

    Holger,

    That worked perfect Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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