Results 1 to 5 of 5

Loop macro to separate spreadsheet into multiple

This is a discussion on Loop macro to separate spreadsheet into multiple within the Excel Questions forums, part of the Question Forums category; Hi everyone Sorry if this question has been asked a million times, but I need a macro to separate one ...

  1. #1
    New Member
    Join Date
    Mar 2012
    Posts
    9

    Default Loop macro to separate spreadsheet into multiple

    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!

  2. #2
    MrExcel MVP Tom Urtis's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, California USA
    Posts
    10,982

    Default Re: Loop macro to separate spreadsheet into multiple

    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.

  3. #3
    New Member
    Join Date
    Mar 2012
    Posts
    9

    Default Re: Loop macro to separate spreadsheet into multiple

    Hi Tom

    Thanks for your reply.

    I have a master spreadsheet eg:

    Name Product ID Result
    Steve 57 good
    Dave 57 good
    Steve 60 ok
    Steve 56 ok
    Steve 34 good
    Dave 56 bad
    Dave 23 bad

    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!!

  4. #4
    New Member
    Join Date
    Mar 2012
    Posts
    9

    Default Re: Loop macro to separate spreadsheet into multiple

    Also, as mentioned above, I have been asked not to use a filter macro because it caused problems last time.

  5. #5
    New Member
    Join Date
    Mar 2012
    Posts
    9

    Default Re: Loop macro to separate spreadsheet into multiple

    bump
    can anyone help me please?

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com