How to split master data into multiple sheets using VBA

Publicado el: 26 abril 2020
en el canal de: Programming Notes
2,025
21

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-cou...

Course URL
Advanced Excel & MIS
http://www.avitguru.com/advanced-exce...

VBA MAcro Automation
http://www.avitguru.com/online-traini...

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


En esta página del sitio puede ver el video en línea How to split master data into multiple sheets using VBA de Duración hora minuto segunda en buena calidad , que subió el usuario Programming Notes 26 abril 2020, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 2,025 veces y le gustó 21 a los espectadores. Disfruta viendo!