我有2张:sheet1和sheet2。我在单元格A3(sheet1)中有一个值不是常数。还有很多文件在sheet2。
我想要做的是,当单元格A3(Sheet1)中的值与A列(Sheet2)中的值相同时,它将删除找到此值的整个行(Sheet2)。 / p>
这是我的尝试。它不起作用:没有行被删除。
Dim varFindThis As Variant
Dim rngLookIn As Range
varFindThis = Worksheets("Sheet1").Range("A3")
Set rngLookIn = Worksheets("Sheet2").Range("A:A")
If Not rngLookIn.Find(varFindThis, LookIn:=xlValues) Is Nothing Then
Dim f As String
f = Worksheets("Sheet1").Range("A3").Value
'Since i didn't got that clear, here above you must create a code to declare "f" as whatever you want
Set c = Worksheets("Sheet2").Range("A:A").Find(f)
Worksheets("Sheet2").Range(c.Address()).EntireRow.Delete
End If
任何解决方案?感谢)))