Excel VBA find string : Error 2015

前端 未结 2 462
天命终不由人
天命终不由人 2020-12-11 19:39

I have to following code snippet ...

  Public Sub FindText(path As String, file As String)
    Dim Found As Range

    myText = \"test(\"

    MacroBook = Ac         


        
2条回答
  •  再見小時候
    2020-12-11 20:07

    As follow up from comments to the Q, Error 2015 occurs because your formula in the sheet returns #VALUE! error. You can handle it using IsError:

    If Not Found Is Nothing Then
        If Not IsError(Found) Then
           ' do sth
        End If
    End If
    

提交回复
热议问题