irisqueiroz
Member
Hi, I'm trying to determine the last row that has a especific text.
I'm sisng the find function, and the code is:
Sub orgDebentures()
'Opções
Range("k6").Select
Do
On Error GoTo erro
Cells.Find(What:="Debentures", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
ActiveCell = "Debentures"
myRow = ActiveCell.Row
Loop Until myRow = 1133
erro:
End Sub
To avoid infinite loop I wrote the statement DO LOOP UNTIL, but I don't know how to determine the last row that contains the word "debentures"... any idea how to solve it?
And other thing... how can I search for this word just in a specific column (K, in this case) and not in all cells of the sheet?
Thanks.
I'm sisng the find function, and the code is:
Sub orgDebentures()
'Opções
Range("k6").Select
Do
On Error GoTo erro
Cells.Find(What:="Debentures", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
ActiveCell = "Debentures"
myRow = ActiveCell.Row
Loop Until myRow = 1133
erro:
End Sub
To avoid infinite loop I wrote the statement DO LOOP UNTIL, but I don't know how to determine the last row that contains the word "debentures"... any idea how to solve it?
And other thing... how can I search for this word just in a specific column (K, in this case) and not in all cells of the sheet?
Thanks.