Copy specific data to a new sheet and save it

Closed
SCorp - Nov 10, 2011 at 10:57 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Dec 1, 2011 at 07:13 AM
Hello,

I am looking for a macro that will copy data based on a specific cell(group name) and paste it to a new workbook. I am also looking for the ability to save the new workbooks with the same filename as the original, with the addition of an underscore and the group name at the end of the filename.

Here is an example of the format of the data

A GroupName C D E F G H ....
x 1 x x x x x x
x 1 x x x x x x
x 2 x x x x x x
x 2 x x x x x x
x 2 x x x x x x
x 3 x x x x x x
x 3 x x x x x x
x 4 x x x x x x
x 4 x x x x x x
x 4 x x x x x x
x 4 x x x x x x
x 5 x x x x x x
x 5 x x x x x x

The original Filename is List_2011-11-10
The original file and filename will be manually created everyday.


I need the new files to only have each specific group (along with the header) and to be saved as so

List_2011-11-10_1
List_2011-11-10_2
List_2011-11-10_3
List_2011-11-10_4
List_2011-11-10_5

I appreciate any help that can be provided to me. If you need any more information, please let me know
Related:

1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Dec 1, 2011 at 07:13 AM
this is how i would approach
1. create a unique list of values of group name in a new temp sheet
2. set filter on the actual sheet
3. loop thru each value from the temp sheet and filter the actual sheet on that.
4. copy the visible row in a new workbook and save it with the name

see this
https://ccm.net/forum/affich-258700-interesting-question-for-excel-champions

this was copying in a new sheet. you want new book. so modify accordingly
0