put this in your worksheet event. I guess that makes me a newbie since I don't have a MS Office Specialist certification
Private Sub Worksheet_Change(ByVal Target As Range)
Dim LR As Long, i As Long
Dim wsP As Worksheet
1 Application.ScreenUpdating = False
Set wsP = Worksheets("Product Line")
If Target.Column = 1 Then
With wsP
LR = .Cells(Rows.Count, 1).End(xlUp).Row
If LR < 5 Then
Application.ScreenUpdating = True
Exit Sub
End If
Worksheets("Purchase Order").Range("A5:F40").ClearContents
For i = 5 To LR
If .Cells(i, 1) > 0 Then
With Worksheets("Purchase Order")
.Cells(.Cells(Rows.Count, 1).End(xlUp).Row + 1, 1) = wsP.Cells(i, 1)
.Cells(.Cells(Rows.Count, 2).End(xlUp).Row + 1, 2) = wsP.Cells(i, 3)
.Cells(.Cells(Rows.Count, 3).End(xlUp).Row + 1, 3) = wsP.Cells(i, 4)
.Cells(.Cells(Rows.Count, 4).End(xlUp).Row + 1, 4) = wsP.Cells(i, 5)
.Cells(.Cells(Rows.Count, 5).End(xlUp).Row + 1, 5) = wsP.Cells(i, 7)
.Cells(.Cells(Rows.Count, 6).End(xlUp).Row + 1, 6) = .Cells(.Cells(Rows.Count, 1).End(xlUp).Row, 1) * .Cells(.Cells(Rows.Count, 1).End(xlUp).Row, 5)
End With
End If
Next i
End With
End If
Application.ScreenUpdating = True
End Sub
Bookmarks