Loop macro to separate spreadsheet into multiple

DLE2885

New Member
Joined
Mar 5, 2012
Messages
9
Hi everyone

Sorry if this question has been asked a million times, but I need a macro to separate one spreadsheet into multiple spreadsheets based on the name in column A

I then need the spreadsheet to be named whatever is in column A.

I got this working fine with a filter macro, but apparently the last time this was used, it omitted data because the spreadsheet is very large and so a looping macro would work better.

It also needs a failsafe mechanism which will check that the correct file was made with the correct entries.

Can anyone help?

Thank you!
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
A couple of clarification items...

So maybe in Sheet1 is a list of items and you want to insert and name a spreadsheet in that same workbook for each item.

What does this mean?
"It also needs a failsafe mechanism which will check that the correct file was made with the correct entries."

What would the logic be for knowing what a correct file is and what a correct entry is? Are you talking about illegal naming characters or something else.

Why did you mention the word "file", if you are working inside a single workbook already, and you are only inserting worksheets in that one workbook file. Are you actually trying to create workbooks or worksheets.
 
Upvote 0
Hi Tom

Thanks for your reply.

I have a master spreadsheet eg:

<style> <!-- BODY,DIV,TABLE,THEAD,TBODY,TFOOT,TR,TH,TD,P { font-family:"Arial"; font-size:x-small } --> </style> <table frame="VOID" rules="NONE" border="0" cellspacing="0" cols="3"> <colgroup><col width="86"><col width="86"><col width="86"></colgroup> <tbody> <tr> <td align="LEFT" height="17" width="86">Name</td> <td align="LEFT" width="86">Product ID</td> <td align="LEFT" width="86">Result</td> </tr> <tr> <td align="LEFT" height="17">Steve</td> <td align="center">57</td> <td align="LEFT">good</td> </tr> <tr> <td align="LEFT" height="17">Dave</td> <td align="center">57</td> <td align="LEFT">good</td> </tr> <tr> <td align="LEFT" height="17">Steve</td> <td align="center">60</td> <td align="LEFT">ok</td> </tr> <tr> <td align="LEFT" height="17">Steve</td> <td align="center">56</td> <td align="LEFT">ok</td> </tr> <tr> <td align="LEFT" height="17">Steve</td> <td align="center">34</td> <td align="LEFT">good</td> </tr> <tr> <td align="LEFT" height="17">Dave</td> <td align="center">56</td> <td align="LEFT">bad</td> </tr> <tr> <td align="LEFT" height="17">Dave</td> <td align="center">23</td> <td align="LEFT">bad</td> </tr> </tbody> </table>
What I want is a looping macro to create a new workbook (i.e. not a sheet within the existing workbook) which is named Dave.xls and Steve.xls

I want the headers included and the formatting to remain the same if possible.

I would also like to define the location to save them.

Is this possible?

With regard to the failsafe check, I was asked to provide this. I understood it as being some kind of check which ensured that Dave.xls only had Dave's information in it and that all of Dave's information was in Dave.xls. If this isn't possible, or makes no sense, that's ok.

Many thanks for your help!!
 
Upvote 0
Also, as mentioned above, I have been asked not to use a filter macro because it caused problems last time.
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top