Experimente o código abaixo no lugar do atual.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cod As Range
'Me.Protect "125812", UserInterFaceOnly:=True
If Target.Address = "$C$3" Then
Set cod = Sheets("config").[A:A].Find(Target.Value, lookat:=xlWhole)
If cod Is Nothing Then MsgBox "Código não encontrado": Exit Sub
With Me
.[C4] = cod.Offset(, 1).Value: .[C5] = cod.Offset(, 2).Value: .[C6] = cod.Offset(, 3).Value
.[K3] = cod.Offset(, 6).Value: .[K4] = cod.Offset(, 4).Value: .[K5] = cod.Offset(, 5).Value
End With
ElseIf Target.Address = "$D$8" Then
With Sheets("Base").Cells(Rows.Count, 1).End(3)(2)
.Value = [A2]: .Offset(, 1).Value = [C4]: .Offset(, 2).Value = [C5]: .Offset(, 3).Value = [B8]
.Offset(, 4).Value = [C8]: .Offset(, 5).Value = [D8]: .Offset(, 6).Value = [E8]
.Offset(, 7).Value = [F8]: .Offset(, 8).Value = [G8]: .Offset(, 9).Value = [H8]
End With
' Range("b8:d8").ClearContents
End If
End Sub
Postado : 11/06/2017 11:10 am