+ Reply to Thread
Results 1 to 7 of 7

Macro to filter and copy to new excel

  1. #1
    Forum Contributor
    Join Date
    06-05-2014
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    155

    Macro to filter and copy to new excel

    Hi Team,

    I am trying to automate a manual activity that I does daily. I am trying to write macro to eliminate this manual activity.

    I have an excel dump with lot of associates tagged under a list of projects. So each project will have so many associates tagged.

    The manual activity that I do is to filter a project, copy all the content and paste it in a new excel. Then filter the 2nd project, copy the content in another new excel and move on to the next project. In this way I split the master dump based on the project id and each project details are saved in individual new excel files.

    I need help in automating this by writing a macro. Based on the project id, all the details in the sheet has to be saved in new excel. So if there are 10 projects in the master dump, each project content should be saved in 10 different excel files.

    Sample data attached. Please help. I am new to macros.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Macro to filter and copy to new excel

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

  3. #3
    Forum Contributor
    Join Date
    06-05-2014
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    155

    Re: Macro to filter and copy to new excel

    Quote Originally Posted by jindon View Post
    Please Login or Register  to view this content.
    This is working perfectly fine.. If you can explain me what the below means it would be of great help and I will be able to change as required..

    For Each e In Filter(.Parent.[transpose(if(countif(offset(d2:d10000,,,row(1:10000)),d2:d1000)=1,d2:d1000,char(2)))], Chr(2), 0)
    .AutoFilter 4, e

    Requesting you explain what " e " means.
    What should I do if the excels should be saved with name as in column E.

  4. #4
    Forum Contributor
    Join Date
    06-05-2014
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    155

    Re: Macro to filter and copy to new excel

    Also if I need to change the filter base from coloum D to column A, where should I make the changes.. Please help..

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Macro to filter and copy to new excel

    e = Element in Array created by Filter function.
    Examine the difference
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    06-05-2014
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    155

    Re: Macro to filter and copy to new excel

    Thank you sir.. That helped a lot..
    Last question - can you plz tell me what chr(2),Chr(3) means..

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Macro to filter and copy to new excel

    Chr function returns string from the character code.

    See VBA Help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] excel macro Filter all sheets with same criteria and copy results to new sheet
    By cpramesh in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-11-2014, 07:13 AM
  2. [SOLVED] Excel 2007-Adv Filter Copy and Loop with Nested Autofilter Using Values from Adv Filter
    By Southfish in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2014, 02:07 AM
  3. Macro that can filter excel data and copy the filtered data to another worksheet
    By glide2131 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-10-2013, 02:43 PM
  4. Replies: 2
    Last Post: 01-26-2013, 04:26 AM
  5. [SOLVED] Need macro to filter, create tab on filter and copy/paste
    By Jen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-02-2006, 11:50 AM

Tags for this Thread

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