Abaixo o seu código corrigido.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim PL1 As Worksheet, PL2 As Worksheet, cont As Long, x As Long
Set PL1 = Sheets("Gestão")
Set PL2 = Sheets("Itens")
cont = PL2.Cells(Rows.Count, "A").End(xlUp).Row
For x = 2 To cont
If PL1.Range("A2") = PL2.Cells(x, "A") Then
Application.EnableEvents = False
PL1.Range("B2").Value = PL2.Cells(x, "B")
Application.EnableEvents = True
End If
Next
End Sub
Se quiser, experimente este outro também.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim k As Long
If Target.Column > 1 Then Exit Sub
If Application.CountIf(Sheets("Itens").[A:A], Target.Value) > 0 Then
k = Sheets("Itens").[A:A].Find(Target.Value, lookat:=xlWhole).Row
Target.Offset(, 1).Value = Sheets("Itens").Cells(k, 2)
End If
End Sub
Postado : 25/03/2017 1:53 pm