Bom dia wessley,
Vê se ajuda:
Option Explicit
Public Sub Busca()
Dim wsIndex As Worksheet
Dim UltL As Long
Dim Lin As Long
Dim i As Long
Application.ScreenUpdating = False
Set wsIndex = ThisWorkbook.Worksheets("Plan1")
UltL = Application.WorksheetFunction.Max(2, wsIndex.Cells(Rows.Count, 8).End(xlUp).Row)
wsIndex.Range("H2:K" & UltL).ClearContents
UltL = wsIndex.Cells(Rows.Count, 1).End(xlUp).Row
Lin = 2
For i = 2 To UltL
If InStr(1, UCase(wsIndex.Cells(i, 2).Value), UCase(wsIndex.Cells(1, 6).Value)) > 0 Then
wsIndex.Cells(Lin, 8).Value = wsIndex.Cells(i, 1).Value
wsIndex.Cells(Lin, 9).Value = wsIndex.Cells(i, 2).Value
wsIndex.Cells(Lin, 10).Value = wsIndex.Cells(i, 3).Value
wsIndex.Cells(Lin, 11).Value = wsIndex.Cells(i, 4).Value
Lin = Lin + 1
End If
Next i
Set wsIndex = Nothing
Application.ScreenUpdating = True
End Sub
Qualquer coisa da o grito.
Abraço
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 04/02/2016 6:22 am