Use this tool to separate your data into multiple sheets ( learn in 2 minutes 37 seconds) 👍

preview_player
Показать описание
use this excel tool to split your data into multiple sheets - save it and reuse it multiple times.. saves time and easy . just copy paste the below code .
use vba to list and separate
-------------------------------------------------------------------
Рекомендации по теме
Комментарии
Автор

Sub split_data ()
Dim lr As Long
Dim ws As Worksheet
Dim vcol, i As Integer
Dim icol As Long
Dim myarr As Variant
Dim title As String
Dim titlerow As Integer
vcol = 1
Set ws = Sheets(1)
lr = ws.Cells(ws.Rows.Count, vcol).End(xlUp).Row
MsgBox lr
title = "A1:C1"
titlerow = ws.Range(title).Cells(1).Row
MsgBox titlerow

icol = ws.Columns.Count
MsgBox icol
ws.Cells(1, icol) = "Unique"
MsgBox icol

For i = 2 To lr
On Error Resume Next
If ws.Cells(i, vcol) <> "" And Application.WorksheetFunction.Match(ws.Cells(i, vcol), ws.Columns(icol), 0) = 0 Then

ws.Cells(ws.Rows.Count, icol).End(xlUp).Offset(1) = ws.Cells(i, vcol)
End If
Next
myarr =
MsgBox ws.Columns(icol)

ws.Columns(icol).Clear
For i = 2 To UBound(myarr)
ws.Range(title).AutoFilter field:=vcol, Criteria1:=myarr(i) & ""
If Not Evaluate("=ISREF('" & myarr(i) & "'!A1)") Then
= myarr(i) & ""
Else
Sheets(myarr(i) & "").Move
End If
ws.Range("A" & titlerow & ":A" & lr).EntireRow.Copy Sheets(myarr(i) & "").Range("A1")
Sheets(myarr(i) & "").Columns.AutoFit
Next
ws.AutoFilterMode = False
ws.Activate
End Sub

learningtechie