+ Reply to Thread
Results 1 to 9 of 9

Split a workbook into different workbooks base on conditions

  1. #1
    Registered User
    Join Date
    02-17-2012
    Location
    Distrito Federal
    MS-Off Ver
    Excel 2010
    Posts
    6

    Question Split a workbook into different workbooks base on conditions

    Hello all.
    I'm having some trouble creating a macro to split a file into smaller and different ones.
    This is how to main file looks like:

    gvf_example_database.xlsx

    What I want to achieve is:
    1- Select, in the first column, a country
    2 - Select, in the second column, a year
    3 - Select, in the third column, a specification
    4 - save that on a specific folder, preferably in the "specification_year_country.xls" format
    5 - loop through all the possible combinations of specification, year and country, and create the file

    I've been trying to implement solutions that i've found on the internet, but to no use...
    I appreciate any help.
    Thank you.

    Gvf
    Attached Images Attached Images
    Last edited by gvf; 02-22-2012 at 09:33 AM.

  2. #2
    Registered User
    Join Date
    02-17-2012
    Location
    Distrito Federal
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Split a workbook into different workbooks base on conditions

    Any help would be appreciated.

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

    Re: Split a workbook into different workbooks base on conditions

    Its better to attach a sample excel file than a jpg. It will save us a lot of time in replicating the jpg.
    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]

  4. #4
    Registered User
    Join Date
    02-17-2012
    Location
    Distrito Federal
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Split a workbook into different workbooks base on conditions

    You're right. I edited my first post with a sample excel file.
    Thank you in advance.

  5. #5
    Registered User
    Join Date
    02-17-2012
    Location
    Distrito Federal
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Split a workbook into different workbooks base on conditions

    Bump no response.

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

    Re: Split a workbook into different workbooks base on conditions

    So ideally there will be 11*4*10 = 440 different workbooks with data to be created?

  7. #7
    Registered User
    Join Date
    02-17-2012
    Location
    Distrito Federal
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Split a workbook into different workbooks base on conditions

    Yes, that would be the upper bound. That's why I want to use a macro, besides learning how to do it the VBA way.

  8. #8
    Registered User
    Join Date
    02-17-2012
    Location
    Distrito Federal
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Split a workbook into different workbooks base on conditions

    Bump no response...

  9. #9
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Split a workbook into different workbooks base on conditions

    Hi gvf
    This code is in the attached. I see some issues with non-printable characters and some fields being empty but perhaps you've anticipated this. In any event, see if this is what you have in mind. Let me know of issues.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

+ 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