Split Master Data into Sheets with VBA

Learn how to split a master Excel sheet into multiple sheets using VBA in this tutorial. πŸ“Š

Split Master Data into Sheets with VBA
Programming Notes
2.0K views β€’ Apr 26, 2020
Split Master Data into Sheets with VBA

About this video

How to split the master spreadsheet into multiple sheets using VBA?
In this video, you will learn how to split data in excel into multiple sheets using VBA?

Sub Split_data()
Dim iRow As Integer
Dim Uniqe_Data As Integer
Dim Rng As Range

'for getting unique field data
Set Rng = Sheet1.Range("D2:D" & Sheet1.Cells(Rows.Count, "D").End(xlUp).Row)
Rng.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Sheet1.Range("M1"), Unique:=True
Uniqe_Data = Sheet1.Cells(Rows.Count, "M").End(xlUp).Row

For iRow = 2 To Uniqe_Data
'applying autofilter
Sheet1.Range("A1:G1").AutoFilter Field:=4, Criteria1:=Sheet1.Range("M" & iRow).Value
'sheet add
Sheets.Add After:=Sheets(Sheets.Count)
'Rename sheet name
Sheets(Sheets.Count).Name = Sheet1.Range("M" & iRow).Value
'Copy Data
Sheet1.Range("A1").CurrentRegion.SpecialCells(xlCellTypeVisible).Copy
'Paste data on new added sheet
Sheets(Sheets.Count).Range("A1").PasteSpecial (xlPasteValues)

Next iRow
Sheet1.AutoFilterMode = False
Application.CutCopyMode = False
MsgBox "Data has been separated.", vbInformation
End Sub

Website name
AVIT Guru

Website URL
http://www.avitguru.com/

Registration Form
http://www.avitguru.com/avit-guru-course-registration

Course URL
Advanced Excel & MIS
http://www.avitguru.com/advanced-excel-mis-training-institute-in-delhi/

VBA MAcro Automation
http://www.avitguru.com/online-training-in-advanced-vba-macro-in-delhi/

MS Access Database
http://www.avitguru.com/ms_access_database_training/

Tags and Topics

Browse our collection to discover more content in these categories.

Video Information

Views

2.0K

Likes

21

Duration

10:03

Published

Apr 26, 2020

User Reviews

4.3
(2)
Rate:

Related Trending Topics

LIVE TRENDS

Related trending topics. Click any trend to explore more videos.