Notifications
Clear all

Código Find

3 Posts
2 Usuários
0 Reactions
973 Visualizações
(@smile)
Posts: 33
Eminent Member
Topic starter
 

Estimados, estou tentanto fazer código que exclui a linha procurada, porém nao to tendo exito no processo, alguém consegue me mostrar aonde está o erro?

Obrigado.

Sub Estoque()

Dim nTexto As String

Sheets("Estoque").Select

nTexto = Sheets("Procurar").Range("A1").Value

Cells.Find(What:="nTexto", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
Rows("8:8").Select
Selection.Delete Shift:=xlUp
Sheets("Procurar").Select
End Sub

 
Postado : 24/03/2014 8:59 am
Fernando Fernandes
(@fernandofernandes)
Posts: 43750
Illustrious Member
 

Experimente

Sub Estoque()
Dim nTexto As String
Sheets("Estoque").Select
nTexto = Sheets("Procurar").Range("A1").Value

    Cells.Find(What:=nTexto, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
    xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
    , SearchFormat:=False).Activate
Selection.EntireRow.Delete Shift:=xlUp
Sheets("Procurar").Select
End Sub

Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel

 
Postado : 24/03/2014 9:17 am
(@smile)
Posts: 33
Eminent Member
Topic starter
 

Deu certo Agradecido!

 
Postado : 24/03/2014 9:24 am