For this code you'll need to define the ranges that correspond to your actual sheet (marked in red):
Private Sub Worksheet_Change(ByVal Target As Range): Dim c As Long, r As Long
Dim Size As String, Code As String, Dec As String, Price As Single
Dim Plst As Range: Set Plst = Range("I16:M18")
Dim Dcml As Range: Set Dcml = Range("C16:G18")
Dim Rslt As Range: Set Rslt = Range("E21:G23")
If Not Intersect(Target, Rslt) Is Nothing Then
Application.EnableEvents = False
Size = Left(Target, 1) & Chr(34): Dec = Right(Target, 4)
If Dec > 1 Then Dec = Right(Target, 3)
c = Dcml.Find(Dec).Column: Code = Cells(Dcml.row, c)
c = Plst.Find(Code).Column: r = Plst.Find(Size).row
Price = Cells(r, c)
Target.Offset(0, 1) = Code: Target.Offset(0, 2) = Price
End If
Application.EnableEvents = True
End Sub
Bookmarks