+ Reply to Thread
Results 1 to 6 of 6

Copy/Paste filtered data from one sheet to another with only matched column headings

  1. #1
    Registered User
    Join Date
    02-20-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    13

    Copy/Paste filtered data from one sheet to another with only matched column headings

    Hi everyone,

    Really appreciate it if you could take a look at this. I have been scratching my head trying to figure out what I did wrong here.

    A simple example of what i am trying to do is: I have a data sheet that has Name/Description/Year information (the source sheet). The second sheet only has a heading "Name" on it (the destination sheet).

    The macro should filter the data by year (say only for the year 2015). Copy and paste only "Name" related data into the column on second sheet.

    However my macro only copy and paste the last record of the filtered range. Could anyone please point out what I did wrong? Thank you very much.

    AC

    Code is here and i also attach the file:


    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy/Paste filtered data from one sheet to another with only matched column headings

    I am not sure if this helps

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-20-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Copy/Paste filtered data from one sheet to another with only matched column headings

    Thanks AB33. This would work for this sample file. But the real file I am working on is a lot bigger and more complicated (has about 60 headings to match on the destination sheet). And the source file will be updated every day. That's why I am trying to figure out a way to easily match row/column dynamically then copy/paste data. Does that make any sense?

    Thank you!

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy/Paste filtered data from one sheet to another with only matched column headings

    Arc,
    Sorry!
    I have not read your request in details. I saw the heading only.
    You probably need to modify this line

    Please Login or Register  to view this content.
    It is looking in to the whole areas as opposed to column A only

  5. #5
    Registered User
    Join Date
    02-20-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Copy/Paste filtered data from one sheet to another with only matched column headings

    Thanks AB33,

    I changed it to For Each rng In Range ("A:A").SpecialCells(xlCellTypeVisible).Areas but it didn't seem to work.

    Any other suggestions?

    Sincerely appreciate your time and help.

    AC

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy/Paste filtered data from one sheet to another with only matched column headings

    I used this line

    Please Login or Register  to view this content.

+ 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