0

We use our excel reports in our virtual desktop. Now we are testing with our reports in Azure Virtual Desktop and there's a excel report coming out of a error:

Cells.Find(What:="zzz", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
        xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
        , SearchFormat:=False).Activate

I don't have much experience with this so i don't see what i have to change. I need some help :) Thank you in advance.

1 Answers1

0

You should activate cell only after successful search.

Set result = Cells.Find(What:="zzz", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
    xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
    , SearchFormat:=False)
If result is Nothing Then
    MsgBox "Nothing found"
Else
    result.Activate
End If
artnib
  • 480
  • 4
  • 7