Ask for advice: use vba to split classification and output TXT text.

Manual operation is also very simple: after sorting, it is processed by PivotTable (multiple consolidated calculation data areas).

Please wait a moment, VBA code.

The code came out:

Sub-divided output ()

Dim arrangement

set DIC 1 = CreateObject(" scripting . dictionary ")

arr = ActiveSheet。 Range ("g1:h"&; Cell (65536, 7). End (3). Row). value

For i = 1 to UBound(arr, 1)

dpts = Split(arr(i,2),",")

For each dpt in the dpts

If DPT < > ""then dic 1. Item(dpt) = dic 1。 Project (dpt) and Chr( 10)arr(i, 1)

then

then

Set arr = none.

dk = dic 1.keys

dt = dic 1.items

n = dic 1。 Count-1

Set dic 1 = none.

Set fs = CreateObject ("script. File system object ")

MyPath = "D:\ classification "

If it is not fs. FolderExists(myPath) Then fs。 Create folder myPath

Set fld = fs. Get Folder (My Path)

For i = 0 to n

Let a = fld. create textfile(" _ " & amp; Dk(i) and ".txt", True)

arr = Split(Mid(dt(i),2),Chr( 10))

For each nb in the arr

A. write line nb

then

A. Shut down

then

Set fld = none.

Set fs = none.

End joint