The following code copies the cell contents from the sheet "Order" to the active sheet depending on the contents of column B written on cell O6 of the active sheet.
Suppose column B of the sheet contains 123; and the user writes this 123 in cell O6 of the active sheet, the range("I9:I10,M9:M10,M15,O9:O11") gets filled up with appropriate data from the sheet "Order"
My question of concern is how to fill the range ("I11:I15,K15,M12,O12") from sheet "List" as the cell I10 gets filled with data from the sheet "Order" with the above code.
Any help on this would be kindly appreciated.
Thanks in advance.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim wshI As Worksheet
Dim rng As Range
If Not Intersect(Range("O6"), Target) Is Nothing Then
Set wshI = Worksheets("Order")
Set rng = wshI.Range("B:B").Find(What:=Range("O6").Value, LookAt:=xlWhole)
If rng Is Nothing Or Range("O6") = "" Then
Range("I9:I10,M9:M10,M15,O9:O11").ClearContents
Else
Range("I9") = rng.Offset(0, 13)
Range("I10") = rng.Offset(0, 1)
Range("M9") = rng.Offset(0, 11)
Range("M10") = rng.Offset(0, 2)
Range("M15") = rng.Offset(0, 5)
Range("O9") = rng.Offset(0, 12)
Range("O10") = rng.Offset(0, 10)
End If
End If
End Sub
My question of concern is how to fill the range ("I11:I15,K15,M12,O12") from sheet "List" as the cell I10 gets filled with data from the sheet "Order" with the above code.
Any help on this would be kindly appreciated.
Thanks in advance.