+ Reply to Thread
Results 1 to 12 of 12

Separate one workbook into multiple workbook based on country

  1. #1
    Registered User
    Join Date
    09-13-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    7

    Separate one workbook into multiple workbook based on country

    I have a workbook contains sales data for many countries (see attachment) Sales Data.zipand I frequently need to separate the file into multiple work files, one files contains only 1 country's sales data, the the file should be named under the country. It is really time consuming... How can I automate the separation process? thanks a million!

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Separate one workbook into multiple workbook based on country

    Welcome to the forum.

    This code should do what you need.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    09-13-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Separate one workbook into multiple workbook based on country

    WOW Fotis this is amazing!! Many thanks~~~
    However, I think I was not clear on the meaning of "files".
    By saying "files" I actually mean workbooks. So instead of separating worksheets I will need the workbooks....

    But this is already very good!!!
    If possible can help to make into workbooks?
    Last edited by Fotis1991; 09-13-2013 at 04:34 AM. Reason: Don't quote whole posts pls.

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Separate one workbook into multiple workbook based on country

    3 Points!

    1) You are welcome!

    2) Unfortumately i am not able for helping you to create multiply Workbooks.


    3) Pls

    Don't quote whole posts -- it's just clutter. If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding.

  5. #5
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Separate one workbook into multiple workbook based on country

    Hi, Fotis1991,

    if I may help out on this one (just added a couple of lines and marked them with a comment):
    Please Login or Register  to view this content.
    I substituted Range("A65536") with Range("A" & Rows.Count) which will reflect the available number of rows for the "new" workbooks from 2007 on.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Separate one workbook into multiple workbook based on country

    @ HaHoBe

    Really nice. Thanks for adding this!

    Let's see what OP says!!

  7. #7
    Registered User
    Join Date
    09-13-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Separate one workbook into multiple workbook based on country

    Thanks guys for the help!!

  8. #8
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Separate one workbook into multiple workbook based on country

    You are welcome and thanks for the feed back.

    As that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED,as per Forum Rule #9. Thank you.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  9. #9
    Spammer
    Join Date
    06-27-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    183

    Thumbs up Re: Separate one workbook into multiple workbook based on country

    Hi Friends,

    Good to see this, i required a small change in it , instead of saving separate file, kindly help to send the workbook as a attachment country wise to the specified mail id.

    Example for Singapore workbook to be sent to aaaa...@ gamil.com and Malaysia to bbb..@gamil.com

    kindly do the needful.

    Prabhu

  10. #10
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Separate one workbook into multiple workbook based on country

    Pls start your own thread as per forum rules.

  11. #11
    Registered User
    Join Date
    02-03-2014
    Location
    Manchester, England
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Separate one workbook into multiple workbook based on country

    Hi Holger,

    The above code works for a similar exercise I am doing however I wondered if you could assist with my query. I am looking to create separate files based on a line manager field, in my case column M. Please can you advise how I can do this so my sheet is split into several files by Manager name.

    Regards

    Phil

  12. #12
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Separate one workbook into multiple workbook based on country

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

    I have already replied to your other thread.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Move row based on second column in separate workbook
    By Alimac70 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-03-2013, 07:12 AM
  2. Finding & Returning Data Based on 2 Parameters from a Separate Workbook
    By andrew.nelson in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-03-2013, 12:28 AM
  3. [SOLVED] Return multiple values from another workbook, based on Column Headers in other workbook
    By GoGators in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-17-2013, 02:11 PM
  4. Create multiple sheets in new workbook based on credentials in source workbook
    By Julesdude in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-07-2011, 10:31 AM
  5. Select sheet tabs in workbook & save to separate workbook files
    By stratocaster in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-01-2006, 11:40 AM

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