Hi Lostinxcel
Try this
Sub UpdateInvoiceSheet()
Dim ws1 As Worksheet: Dim ws2 As Worksheet
Dim rRpt As Range
Set ws1 = Worksheets("Receipts PYMT 2010")
Set ws2 = Worksheets("Invoice Cost Overview 2010")
y = ws2.UsedRange.Rows.Count + 1
For Each rRpt In ws1.Range("E2:E" & ws1.UsedRange.Rows.Count)
If rRpt = 0.7 Or rRpt = 1 Then
If Not rRpt.Offset(0, 8).Value = "x" Then 'put this marker column anywhere you want
ws2.Cells(y, "B") = ws1.Cells(rRpt.Row, "I")
ws2.Cells(y, "C") = ws1.Cells(rRpt.Row, "A")
ws2.Cells(y, "D") = ws1.Cells(rRpt.Row, "G")
y = y + 1
rRpt.Offset(0, 8).Value = "x" 'after you've used the item, mark it so it's not duplicated
End If
End If
Next rRpt
End Sub
The code places a marker in Receipts PYMT 2010 when an Item is used so it doesn't get used again.
Hope this helps.
John
Bookmarks