如果cl不为空,则阻止“ If Not cl Is Nothing Then”跳过代码行(相反,使其搜索其他条件)

时间:2019-12-29 08:38:41

标签: excel vba if-statement

如果找不到“目标”,如何使它搜索另一个词,如“沃尔玛”,如果找不到“目标”,如何使它搜索另一个词,例如“ Dillions”,依此类推。

Set cl = Range("D:D").Find("Target")

If Not cl Is Nothing Then
    cl.Select
    cl.Resize(1, 2).Select
    Selection.Copy
    ActiveSheet.Paste Destination:=Range("G1")
End If

0 个答案:

没有答案