Split an Excel File in to Many using VBA [Videos]

Share

Facebook
Twitter
LinkedIn

Splitting an Excel file in to many is easier than splitting bill in a restaurant among friends. All you need is advanced filters, a few lines of VBA code and some data. You can go splitting in no time.

Context:

Lets say you have lots of data like this in a file. And you want to split this in to multiple files, one per salesperson.

Splitting An Excel File in to Many using VBA - Example Data

Solution – Split Data in to Multiple Files using Advanced Filters & VBA

The process of splitting data can be broken down to 4 steps.

  1. Identify the split criteria and list down all values in a small range. In our case, we list all the salespersons names in a named range lstSalesman.
    List of all salespersons - Splitting data in to multiple files using VBA
  2. Set up advanced filters so that we can filter the data by one salesman at a time.
    Range where advanced filter criteria will be specified - Splitting data in to multiple files
  3. Now, for each salesman, apply advanced filters and set it to copy the filtered values elsewhere.
    1. Copy the filtered values
    2. Add a new workbook and paste the copied values there.
    3. Save the new workbook with a unique name
    4. Repeat the above 3 steps for each salesman
  4. That is all! You are done splitting.

Video Lesson on Splitting Data using Filters & VBA

Since splitting data in to multiple files requires a bit of macro code & advanced filter knowledge, I have created a short lesson explaining how this works. Watch it below.

[If you are not able to see the video, watch it on our Youtube Channel]

If you are new to VBA, take our crash course.

Download Split Data Example Workbook

Click here to download the split data example workbook.To use this,

  1. Save the downloaded file to any folder.
  2. Open the file and enable macros.
  3. Examine everything and when ready, click on “Extract” button.
  4. Check the folder where you saved the file and you will fine 4 new Excel workbooks named after the salespersons with the data extracted for them.

You can find the macro code in Module 1.

How do you Handle Splitting Situations?

In my work, I rarely had to split data. And whenever I had to split data, I usually copy paste the data after filtering what I want. But I can imagine many real life scenarios where you need to automate the splitting part.

How do you split data? What techniques and ideas you use to speed up the splitting process? Please share using comments.

More on Splitting & Consolidation

If you are in to splitting or combining things, we have a selection of tips & examples to help you. Check out these articles.

PS: Heck, we have even have an Excel tip to tell you how to split expenses among friends 😛
PPS: You can use Pivot Table Report Filters if you want to split data in to multiple sheets.

Facebook
Twitter
LinkedIn

Share this tip with your colleagues

Excel and Power BI tips - Chandoo.org Newsletter

Get FREE Excel + Power BI Tips

Simple, fun and useful emails, once per week.

Learn & be awesome.

Welcome to Chandoo.org

Thank you so much for visiting. My aim is to make you awesome in Excel & Power BI. I do this by sharing videos, tips, examples and downloads on this website. There are more than 1,000 pages with all things Excel, Power BI, Dashboards & VBA here. Go ahead and spend few minutes to be AWESOME.

Read my storyFREE Excel tips book

Overall I learned a lot and I thought you did a great job of explaining how to do things. This will definitely elevate my reporting in the future.
Rebekah S
Reporting Analyst
Excel formula list - 100+ examples and howto guide for you

From simple to complex, there is a formula for every occasion. Check out the list now.

Calendars, invoices, trackers and much more. All free, fun and fantastic.

Advanced Pivot Table tricks

Power Query, Data model, DAX, Filters, Slicers, Conditional formats and beautiful charts. It's all here.

Still on fence about Power BI? In this getting started guide, learn what is Power BI, how to get it and how to create your first report from scratch.

4 Responses to “Best of Chandoo.org – 2013”

  1. Kushal K Shah says:

    sir i want your autograph

  2. Maxim Manuel says:

    How many times during the year did I click on most of the pages there to learn something new? Thank you Chandoo!

  3. Cad says:

    =TEXTSPLIT(jobs[Job title],{" - "," ("," /"})

  4. Cad says:

    =TEXTSPLIT(jobs[Job title],{" - "," ("," /"})

    =CHOOSECOLS(TEXTSPLIT([@[Job title]],{" - "," ("," /"}),1) -- for tables

Leave a Reply