How to Split Excel Sheet into Multiple Sheets Based on Column Value

If you are looking for some of the easiest ways to split an Excel sheet into multiple sheets based on column value, then you will find this article useful.

Sometimes it becomes necessary to split a large set of data based on a column and work on multiple sheets after splitting up the main sheet. To know the ways of doing this job effectively let’s dive into the article.

Splitting Excel sheet into multiple sheets based on column value


Split Excel Sheet into Multiple Sheets Based on Column Value: 5 Simple Ways

We will use the following data table containing the result of different students at a college. Now, we will split this sheet into three sheets based on the Student Name column for the three students.

For this purpose, We are using Microsoft Excel 365 version, but you can use any other version at your convenience.

Dataset which we want to split into multiple sheets


1. Use FILTER Function to Split Excel Sheet into Multiple Sheets

If you want to split the datasheet into multiple sheets based on the column Student Name, then you can use the FILTER function. Here, we will split the following sheet into three sheets containing the data for Daniel Defoe, Henry Jackson, and Donald Paul respectively.

Splitting Excel sheet into multiple sheets based on Student Names

Steps:

  • Firstly, create three sheets named after the three students’ names.
  • Then, select a cell, like Cell B3 in the sheet for the student Daniel Defoe.

Creating three new sheets

  • Next, type the following formula.
=FILTER(Filter!B5:D16,Filter!B5:B16="Daniel Defoe")

Using FILTER function to get data for “Daniel Defoe”

  • After that, press Enter.
  • Now, you will get the data for the student Daniel Defoe in the sheet for this student.

Final Output of Using FILTER function for “Daniel Defoe”

Here, in the formula, Filter!B5:D16 is the data range without header in the main sheet which is named Filter, and Filter!B5:B16 is the range of the Student Name in the main sheet and it would be equal to “Daniel Defoe”.
  • Finally, let’s type the header name above all of the columns and format this data table.

Adding header and formatting dataset

  • After following the above steps of this method for the other two sheets for the students’ Henry Jackson and Donald Paul, you will get the following two tables in their respective sheets.

Using FILTER function to get data for “Henry Jackson”

Using FILTER function to get data for “Donald Paul”


2. Apply Pivot Table to Split Excel Sheet into Multiple Sheets Based on Column Value

You can split the following sheet into three sheets for the three students based on the column Student Name by using the Pivot Table.

Steps:

  • In the beginning, go to Insert Tab>> click on PivotTable Option.

Inserting Pivot Table to split Excel sheet into multiple sheets

  • Then, PivotTable from table or range Dialog Box will appear.
  • Next, select the Table/Range.
  • After that, click on New Worksheet (it’s a good practice to place Pivot Table into a new sheet).
  • Lastly, press OK.

PivotTable from table or range dialog box

  • Now, a new sheet will open up which has two parts; PivotTable1 and PivotTable Fields.

Creating pivot table in new worksheet

  • Then, drag down the Student Name in the Filters area (any column on the basis of which you want to split the main sheet into multiple sheets) and Subject and Grade to the Rows area.

Dragging fields in Filter and Rows area

  • Afterward, go to Design Tab >> click on Layout Group >> click on Report Layout Dropdown >> select Show in Outline Form Option.

Selecting Outline Form from Report Layout

  • Again, from Design Tab >> click on Layout Group >> click on Grand Totals Dropdown >> select Off for Rows and Columns Option.

Turning off grand totals for rows and columns

  • After that, go to PivotTable Analyze Tab>> click on PivotTable Group >> click on Options Dropdown >> select Show Report Filter Pages Option.

Selecting Show Report Filter Pages Option

  • Now, the Show Report Filter Pages wizard will pop up.
  • Next, select the column Student Name which was in the Filters area.
  • Lastly, press OK.

Selecting Student Name as Filter option

  • Finally, you will get three different sheets for the three students Daniel Defoe, Henry Jackson, and Donald Paul respectively.

Splitting Excel sheet into multiple sheets based on column value using Pivot Table

Splitting Excel sheet using Pivot Table for “Donald Paul”

Splitting Excel sheet using Pivot Table for “Henry Jackson”


3. Split Excel Sheet into Multiple Sheets Using Insert Slicer Option After Creating Table

For splitting the main sheet into multiple sheets based on the Student Name column you can use the Table Option.


Step-01: Create Multiple Sheets

We will create multiple sheets to split our dataset based on column value.

  • Firstly, create three sheets named after the three students’ names.
  • Secondly, copy the data table from the main sheet and paste it into these three different sheets.

Creating multiple sheets to use Insert Slicer option


Step-02: Insert Table

Next, we will show you how to insert a table to use Insert Slicer option.

  • To start with, go to Insert Tab >> click on Table Option.

Creating table to split excel sheet into multiple sheets based on column value

  • Then, the Create Table dialog box will appear.
  • Next, select the data for your Table.
  • Afterward, turn on My table has headers option.
  • Lastly, press OK.

Opening Create Table box

  • After that, the following table will be created.

Dataset after creating a table


Step-03: Use Insert Slicer Option

In the final step, we will use the Insert Slicer option from Table Design tab. Make sure you have clicked on any cell of the table to open this tab option.

  • Then, go to Table Design Tab>> click on Tools Dropdown >> select Insert Slicer Option.

Using Insert Slicer Option from Table Design tab

  • Now, Insert Slicers dialog box will pop up.
  • Next, select the Student Name column (the column based on which you want to split the sheet).
  • Finally, press OK.

Opening Insert Slicer Dialog Box

  • After that, a Student Name box will appear which has three options (three student names).

Dataset with Slicer options based on Student Names

  • Now, click on Daniel Defoe for this sheet.
  • Thus, You will get the data for the student Daniel Defoe.

Selecting “Daniel Defoe” in the slicer box

  • Similarly, you can create the other two sheets for Henry Jackson and Donald Paul as below.

Selecting “Henry Jackson” in the slicer box

Selecting “Donald Paul” in the slicer box


4. Employ Filter Feature to Split Excel Sheet into Multiple Sheets

For splitting the main sheet into multiple sheets based on the Student Name column we will use the Filter option in this method.

Steps:

  • To start with, create three sheets named after the three students’ names.
  • After that, copy the data table from the main sheet and paste it into these three different sheets.

Creating multiple sheets to employ Filter Feature to split Excel sheet into multiple sheets

  • Next, select the data table.
  • Then, go to Data Tab >> click on Sort & Filter >> select Filter Option.

Using Filter Feature to split excel sheet into multiple sheets based on column value

  • Now, the Filter Option will be activated for this data table.
  • After that, click on the Dropdown sign in the Student Name column.

Clicking on Filter dropdown button

  • Lastly, select the name Daniel Defoe for this sheet and press OK.

Filtering for “Daniel Defoe”

  • Finally, you will get the data for the student Daniel Defoe in the sheet for this student.

Dataset after Filtering for “Daniel Defoe”

  • Similarly, follow the above steps to get the other two sheets for Henry Jackson and Donald Paul as below.

Dataset after Filtering for “Henry Jackson”

Dataset after Filtering for “Donald Paul”

Related Article: How to Split Excel Sheet into Multiple Worksheets


5. Use VBA to Split Excel Sheet into Multiple Sheets Based on Column Value

You can split a sheet into multiple sheets based on column value by using a VBA code like this method. To use this method, make sure your dataset starts from Cell A1 like the image shown below.

Dataset to Use VBA to Split Excel Sheet into Multiple Sheets Based on Column Value

Steps:

  • Firstly, go to Developer Tab >> click on Visual Basic Option.

Selecting Visual Basic option from Developer tab

  • Then, the Visual Basic Editor will open up.
  • Next, go to Insert Tab>> select Module Option.

Opening Visual Basic Editor box

  • Now, write the following code in the module.
Sub Splitsheet1()
Dim lr1 As Long
Dim sheet As Worksheet
Dim verticle_colmn, i As Integer
Dim icolmn1 As Long
Dim dataset As Variant
Dim title1 As String
Dim titlerow1 As Integer
Dim title_range As Range
Dim verticle_range As Range
Dim datarange As Worksheet
On Error Resume Next
Set title_range = Application.InputBox("Select header row:", "", Type:=8)
If TypeName(title_range) = "Nothing" Then Exit Sub
Set verticle_range = Application.InputBox _
("Select the column range on the basis of which split data:", "", Type:=8)
If TypeName(verticle_range) = "Nothing" Then Exit Sub
verticle_colmn = verticle_range.Column
Set sheet = title_range.Worksheet
lr1 = sheet.Cells(sheet.Rows.Count, verticle_colmn).End(xlUp).Row
title1 = title_range.AddressLocal
titlerow1 = title_range.Cells(1).Row
icolmn1 = sheet.Columns.Count
sheet.Cells(1, icolmn1) = "Unique"
Application.DisplayAlerts = False
If Not Evaluate("=ISREF('title_rangeWs_Sheet!A1')") Then
Sheets.Add(after:=Worksheets(Worksheets.Count)).Name = "title_rangeWs_Sheet"
Else
Sheets("title_rangeWs_Sheet").Delete
Sheets.Add(after:=Worksheets(Worksheets.Count)).Name = "title_rangeWs_Sheet"
End If
Set datarange = Sheets("title_rangeWs_Sheet")
title_range.Copy
datarange.Paste Destination:=datarange.Range("A1")
sheet.Activate
For i = (titlerow1 + title_range.Rows.Count) To lr1
On Error Resume Next
If sheet.Cells(i, verticle_colmn) <> "" And Application.WorksheetFunction. _
Match(ws.Cells(i, verticle_colmn), sheet.Columns(icolmn1), 0) = 0 Then
sheet.Cells(sheet.Rows.Count, icolmn1).End(xlUp).Offset(1) = sheet.Cells(i, verticle_colmn)
End If
Next
dataset = Application.WorksheetFunction.Transpose(sheet.Columns(icolmn1). _
SpecialCells(xlCellTypeConstants))
sheet.Columns(icolmn1).Clear
For i = 2 To UBound(dataset)
sheet.Range(title1).AutoFilter field:=verticle_colmn, Criteria1:=dataset(i) & ""
If Not Evaluate("=ISREF('" & dataset(i) & "'!A1)") Then
Sheets.Add(after:=Worksheets(Worksheets.Count)).Name = dataset(i) & ""
Else
Sheets(dataset(i) & "").Move after:=Worksheets(Worksheets.Count)
End If
datarange.Range(title1).Copy
Sheets(dataset(i) & "").Paste Destination:=Sheets(dataset(i) & "").Range("A1")
sheet.Range("A" & (titlerow1 + title_range.Rows.Count) & ":A" & lr1) _
.EntireRow.Copy Sheets(dataset(i) & "").Range("A" & (titlerow1 + title_range.Rows.Count))
Sheets(dataset(i) & "").Columns.AutoFit
Next
datarange.Delete
sheet.AutoFilterMode = False
sheet.Activate
Application.DisplayAlerts = True
End Sub

Code for splitting excel sheet into multiple sheets based on column value

Code Breakdown

  • In the beginning, we declared different variables as Long, Integer, Worksheet, Variant, String, and Range.
  • Then, we used multiple IF Statements and For Next Loop for splitting up the sheet into multiple sheets.
  • Afterward, click on the save button to save the code and return back to your worksheet.

Saving Code

  • Further, go to the Developer tab >> click on Macros.

Selecting Macros from Developer tab

  • Now, the Macros box will appear.
  • Next, select Splitsheet1.
  • After that, click on Run.

Opening Macro dialog box to select the code

  • Then, Select header row: Dialog Box will open up.
  • Select the range of the header row and press OK.

Selecting header row

  • After that, Select the column on the basis of which split data: Wizard will pop up.
  • Select the Student Name column and press OK.

Selecting column range

  • Finally, you will get the three sheets for Daniel Defoe, Henry Jackson, and Donald Paul as below.

Splitting Excel sheet using VBA for “Daniel Defoe”

Splitting Excel sheet using VBA for “Henry Jackson”

Splitting Excel sheet using Pivot Table for “Donald Paul”

Here we have used the paste destination at the A1 cell, that’s why split datasets are started from that cell.

Read More: How to Split a Workbook to Separate Excel Files with VBA Code


Practice Section

For doing practice by yourself we have provided a Practice Section. Please do it by yourself.

Practice Sheet


Download Practice Workbook

You can download the practice workbook from here.


Conclusion

In this article, we tried to cover the easiest ways to split an Excel sheet into multiple sheets based on column values effectively. Hope you will find it useful. If you have any suggestions or questions, feel free to share them with us.


Related Articles


<< Go Back to Split Excel Cell | Excel Worksheets | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Tanjima Hossain
Tanjima Hossain

TANJIMA HOSSAIN is a marine engineer who enjoys working with Excel and VBA programming. For her, programming is a handy, time-saving tool for managing data, files, and online tasks. She's skilled in Rhino3D, Maxsurf C++, MS Office, AutoCAD, and Excel & VBA, going beyond the basics. She holds a B.Sc. in Naval Architecture & Marine Engineering from BUET and is now a content developer. In this role, she creates tech-focused content centred around Excel and VBA. Apart from... Read Full Bio

8 Comments
  1. Hi

    Really useful tool – is there a limit on character length for the data being used. I’m having an issue where some tabs are not being prepared and that’s the only thing I can think of.

    Thanks

    • Hello Richard,
      Thanks for your question. The maximum number of sheets in a workbook is 255. So, if you have values for more than 255 rows in a sheet on the basis of which you will create multiple sheets then you may face a problem.

  2. Method 5 works like a charm. Very easy to use. Did not have to amend a single line.
    “Hardest” part was getting Excel to show Developer Menu on the band. 😀

  3. On spreadsheets with many rows, this script seems to hang and loop. Any idea why?

    • Hi RICK,
      The maximum number of sheets in a workbook is 255. So, if you have values in rows on basis of which you will split your sheet for more than 255 rows, then you may face a problem.

  4. This was so useful. Thank you so much for helping us who are Excel deficient.

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo