Hi there, need help on this..
Everything works great, until despesa_encontrada is Nothing. On the italic part gives me error 91 : "Object variable or With block variable not set"
I think I have all right.
Thank you in advance.
VBA Code:
tipo_despesa="Bank Comission"
ActiveSheet.Range("E6:E" & lastcell_geral).Select
Set despesa_encontrada = Selection.Find(What:=tipo_despesa, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=True, SearchFormat:=False)
If Not despesa_encontrada Is Nothing Then
firstadress = despesa_encontrada.Address
despesa_encontrada.Value = ""
despesa_encontrada.Interior.ColorIndex = 35
Do
despesa_encontrada.Interior.ColorIndex = 35
despesa_encontrada.Value = ""
Set despesa_encontrada = Selection.FindNext([B]despesa_encontrada[/B])
[I]Loop While Not despesa_encontrada Is Nothing And despesa_encontrada.Address <> firstadress[/I]
End If
I think I have all right.
Thank you in advance.