+ Reply to Thread
Results 1 to 7 of 7

Macro to Filter Data and Paste in new Workbooks

  1. #1
    Registered User
    Join Date
    10-14-2010
    Location
    Minnesota
    MS-Off Ver
    Excel 2003
    Posts
    23

    Macro to Filter Data and Paste in new Workbooks

    Here's my situation (and please refer me to a different thread if this has been spoken to before): I have a master list of data that I want to automatically splice and put in new workbooks. The data should be filtered on column C (Header 3 in the example). Each value when filtered in Column C needs to be included and copied over to a new worksheet, saved, closed, and repeat for the next value (in the example, there would be 5 new workbooks--Blue, Yellow, Black, Red, Orange). All columns and headers of the master list of data should be included when copying over the data. Also, if possible I want to name the .xls file as the value in Column C each time (e.g., Blue.xls). Since my data is confidential I have used some dummy data for reference. See attached.
    Attached Files Attached Files
    Last edited by willy91785; 10-18-2010 at 03:59 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to Filter Data and Paste in new Workbooks

    'SHEET1 TO MANY WORKBOOKS

    I have a macro that may be "ready to use" for parsing rows of data from one sheet to many workbooks named for the same values.My macro names the workbooks for values in the column PLUS today's date, you can take a stab at removing the date part...or leave it in, it's a good technique.


    I added it to your workbook and changed these three lines of code and it worked great
    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 12-27-2019 at 10:54 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    09-29-2010
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Macro to Filter Data and Paste in new Workbooks

    Hi Chiranjeevi here

    please find the dummy sheet; currently i am using 2007 excel

    1. i want to wrap the entire sheet(sheetname-duplicate)
    2. go to column S(Cat), filter it by A.
    3.copy the filtered rows(only the visible rows with heading row)
    4.create a new sheet called A and paste the copied rows to it
    5.go back to sheet "duplicate" and filtered the column S(Cat), filter it by F.
    6.copy the filtered rows(only the visible rows with heading row)
    4.create a new sheet called F and paste the copied rows to it.


    please anyone help me on this ASAP
    Attached Files Attached Files

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro to Filter Data and Paste in new Workbooks

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Registered User
    Join Date
    10-14-2010
    Location
    Minnesota
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Macro to Filter Data and Paste in new Workbooks

    Awesome! Works great. I'm hoping you can help me with one final thing. When I open up any of the files after they are saved and the macro is run, all cells are highlighted. Can you add a line of code under "Cleanup" that selects cell A1 (just so it looks presentable). Thank you!

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to Filter Data and Paste in new Workbooks

    You can slip in a line before the macro saves the file:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-14-2010
    Location
    Minnesota
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Macro to Filter Data and Paste in new Workbooks

    Thank you. You can call this thread Solved.

+ 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