我正在研究ICN插件(3.0.3)。基本上,我想像this
那样划分页面下面是我的模板代码
Option Explicit
Sub wytrt()
Dim arr As Variant, i As Long, dict As Object
Set dict = CreateObject("scripting.dictionary")
dict.comparemode = vbTextCompare
With ActiveSheet
If .AutoFilterMode Then .AutoFilterMode = False
arr = .Range(.Cells(2, "D"), .Cells(.Rows.Count, "N").End(xlUp)).Value2
For i = LBound(arr, 1) To UBound(arr, 1)
If arr(i, UBound(arr, 2)) <> vbNullString Then
dict.Item(arr(i, LBound(arr, 2))) = CStr(arr(i, LBound(arr, 2)))
End If
Next i
With .Range(.Cells(1, "D"), .Cells(.Rows.Count, "D").End(xlUp))
.AutoFilter Field:=1, Criteria1:=dict.items, Operator:=xlFilterValues
'Debug.Print .Offset(1, 0).SpecialCells(.xlCellTypeVisible).Address(0, 0)
.Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
End With
If .AutoFilterMode Then .AutoFilterMode = False
End With
End Sub
可能是什么原因?
我尝试过的事情