Results 1 to 2 of 2

Copy and pasting filtered data

Threaded View

  1. #1
    Registered User
    Join Date
    06-23-2010
    Location
    Cincinnati, Ohio
    MS-Off Ver
    Excel 2003
    Posts
    2

    Copy and pasting filtered data

    I am very new at using macros and only know how to record macros using the recorder. I know nothing about code. I tried to record a macro that copies filtered data from one worksheet to another, but it doesn't work. Here is the code:

    Sub Macro6()
    '
    ' Macro6 Macro
    ' Macro recorded 6/23/2010 by n0200686
    '
    
    '
        Selection.AutoFilter Field:=7, Criteria1:="Yes"
        Range("D2").Select
        Range(Selection, Selection.End(xlDown)).Select
        Range(Selection, Selection.End(xlToLeft)).Select
        Selection.Copy
        Sheets("DUPLICATE_AGENCY_CODE").Select
        Range("A2").Select
        ActiveSheet.Paste
        Sheets("QUERY_FOR_AGENCY_HIERARCHY").Select
        Application.CutCopyMode = False
        Range("A1").Select
        Sheets("DUPLICATE_AGENCY_CODE").Select
        Range("A1").Select
    End Sub
    I have been looking at other posts to learn how to do this, but I don't even know where to insert new code. Thanks!
    Last edited by davesexcel; 06-23-2010 at 08:07 PM. Reason: code tags required read the rules

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