Current location - Health Preservation Learning Network - Slimming men and women - Excel uses vba to copy multiple worksheets according to a column of data!
Excel uses vba to copy multiple worksheets according to a column of data!
Option explicit

Sub All tables are duplicates ()

Dim st As worksheet, arr, i&, rlt$( 1 to 1000000, 1 to 1), n & ampj & amp new.

Statistical results of array rlt

For each st in the table

If st.usedrange.rows.count >; Then 1

Arr = saint UsedRange

For i = 1 to UBound(arr)

arr(i, 1) = Trim(arr(i, 1))

If arr(i, 1)& lt; & gt ""So

isnew = 1

For j = 1 to n

If rlt(j, 1) = arr(i, 1), then

isnew = 0

Quit for ...

If ... it will be over.

Next J.

If it is new, then

n = n + 1

rlt(n, 1) = arr(i, 1)

If ... it will be over.

If ... it will be over.

Next, I

If ... it will be over.

Next street

The results are saved in a new table.

Use a workbook. increase

With. Zhang (1). Cell (1, 1). Resize (n, 1)

. NumberFormat = "@ "

. Value = rlt

. choose

End with ...

End with ...

End joint