|
Sub 新建工作表()
Application.ScreenUpdating = False
Dim ar As Variant
Dim i As Long, r As Long, rs As Long
Dim d As Object
Set d = CreateObject("scripting.dictionary")
With Sheets("单元号")
r = .Cells(Rows.Count, 1).End(xlUp).Row
If r < 2 Then MsgBox "单元号工作表为空,请先导入数据!": End
ar = .Range("a1:b" & r)
End With
For Each sh In Sheets
If sh.Index > 2 Then
d(sh.Name) = ""
End If
Next sh
For i = 2 To UBound(ar)
If ar(i, 1) <> "" And ar(i, 2) <> "" Then
s = ar(i, 1) & "|" & ar(i, 2)
If Not d.exists(s) Then
Sheets("模板").Copy after:=Sheets(Sheets.Count)
With ActiveSheet
.Name = s
.[z4] = ar(i, 1)
.[f7] = ar(i, 2)
End With
End If
End If
Next i
Application.ScreenUpdating = True
MsgBox "ok!"
End Sub
|
评分
-
1
查看全部评分
-
|