Closed Thread
Results 1 to 9 of 9

Filter, copy filtered data into another sheet, create a file of that sheet..

  1. #1
    Registered User
    Join Date
    02-16-2005
    Location
    Dubai, UAE
    MS-Off Ver
    365
    Posts
    40

    Thumbs down Filter, copy filtered data into another sheet, create a file of that sheet..

    Hi there,

    I have been searching the forum now for a while on filtering through VBA but the examples cited don't match what I am looking for, and I am not that good at VB to modify what I found to meet my requirements.

    Here is what I need to do.

    I have a list of items assigned to a person. There are a few persons in the list, each with different items belonging to them.

    1. I would like to create a single sheet for each person, listing his items. If the sheets already exist (running the macro for the 2nd time, the contents should be erased and recreated)
    2. I would like to have each person have his own excel FILE, so I can email it to them (e.g. peter.xls, maria.xls, frank.xls,...). Once again, if the excel file already exists, it can be deleted and replaced whenever the macro is run.

    Attached please see an example.

    NOTE: I don't want to manually autofilter in case anybody suggests that. This needs to be fully automated.

    Thanks for your help, appreciate it!!
    Titus
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    02-16-2005
    Location
    Dubai, UAE
    MS-Off Ver
    365
    Posts
    40

    Re: Filter, copy filtered data into another sheet, create a file of that sheet..

    Just one more thing (sorry if it's too much to ask ;-).

    Would it be possible to SORT the data in the created sheets and files in ASCENDING order by the number of items?

    E.g.

    2 shoes
    3 horses
    5 coffees

    etc...

    Thanks again ;-)
    Titus

  3. #3
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: Filter, copy filtered data into another sheet, create a file of that sheet..

    See attached file where I used this macro:
    Please Login or Register  to view this content.
    Regards,
    Antonio
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    02-16-2005
    Location
    Dubai, UAE
    MS-Off Ver
    365
    Posts
    40

    Re: Filter, copy filtered data into another sheet, create a file of that sheet..

    Wow, this is impressive! And it's working like a charm! Thanks so much, you're a genius!!

    One more question though: if I have an Excel file with more columns of data, how I can get the macro to work, exporting files with all the other columns of data?

    The logic stays the same: column1 contains the filename and column2 needs to be sorted by number.
    Probably takes you 10 seconds, would mean hours to me ;-)

    Thanks so much, this is really great!
    Titus

  5. #5
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: Filter, copy filtered data into another sheet, create a file of that sheet..

    This new version copy all the row in new sheets so it copies all columns.

    Regards,
    Antonio
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    02-16-2005
    Location
    Dubai, UAE
    MS-Off Ver
    365
    Posts
    40

    Re: Filter, copy filtered data into another sheet, create a file of that sheet..

    Thanks a lot, grazie mille da Roma! ;-)

    I really hate to ask this, but it is there a way to also have the headers of the additional columns exported into the new files? It is only exporting the titles "Name" and "items", but if there were a third column header like "color", it doesn't parse it...

    Thanks so much, I'll by you a nice beer, should you ever be in Rome...
    Last edited by titushanke; 01-28-2011 at 02:06 PM.

  7. #7
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: Filter, copy filtered data into another sheet, create a file of that sheet..

    I added label 'Color'.

    Regards,
    Antonio
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    06-17-2012
    Location
    Riga
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Filter, copy filtered data into another sheet, create a file of that sheet..

    Hello,
    I am a somewhat advanced Excel user but a poor soul when it comes to macros... It would be extremely helpful if someone could tweak this macro - to do exactly what it does now - but instead of creating a new workbook file with the filtered data, to just extract the filtered data to another blank worksheet in the same workbook?
    Also, once the extracted data is there... if the user again re-filters the data on the criteria page, and then clicks the "Run Macro" button, the old data on the destination sheet will delete, and the new filtered data will replace it?
    This would be great if someone could help me out with this code... thank you very much!!
    Matt

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Filter, copy filtered data into another sheet, create a file of that sheet..

    Matt,

    Welcome to the Forum, unfortunately:

    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. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

Closed Thread

Thread Information

Users Browsing this Thread

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

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