2
VBA新功能。我正在使用下面的代码来识别和删除Sheet1中在Sheet2的列C中具有重复值的行,但我需要的代码为而不是删除已从过滤器隐藏的行。仅删除可见行的可见副本
我已经搜索周围,并尝试使用.SpecialCells(xlCellTypeVisible),但我不知道在哪里放置它。我认为另一种选择是使用EntireRow.Hidden语法,但我不知道如何合并。
任何帮助表示赞赏。
Sub DeleteDuplicates()
Application.ScreenUpdating = False
Dim Row As Long
Dim FoundDup As Range
Sheets("Sheet1").Select
For Row = Range("C65536").End(xlUp).Row To 2 Step -1
Set FoundDup = Sheets("Sheet2").Range("C:C").Find(Cells(Row, 3), LookIn:=xlValues, lookat:=xlWhole)
If Not FoundDup Is Nothing Then
Cells(Row, 3).EntireRow.Delete
End If
Next Row
Application.ScreenUpdating = True
End Sub
如果解决方案工作,请注明答案接受。 (点击旁边的复选标记。):-) – nwhaught