ndendrinos
Well-known Member
- Joined
- Jan 17, 2003
- Messages
- 1,694
I want to replace this line:
of this code:
To be Rows("56:56") as this will never change
Thank you
Code:
TgtRw = .Cells(Rows.Count, 1).End(xlUp).Offset(1).Row
of this code:
Code:
Dim TgtRw As Long
Dim Dt
Dim Inv
Dim Inventorylist As Range
Dim c As Long
With Sheets("Invoice")
Dt = .Range("H4").Value
Inv = .Range("H2").Value
End With
'Sheets("Stock").Activate
With Sheets("Invoice")
TgtRw = .Cells(Rows.Count, 1).End(xlUp).Offset(1).Row
Set Inventorylist = .Range("invrow54")
End With
Cells(TgtRw, 1) = Dt
Cells(TgtRw, 2) = Inv
For Each Cel In Range("Products")
c = Application.Match(Cel, Inventorylist, 0)
Cells(TgtRw, c) = -Cel.Offset(, -2)
Next
To be Rows("56:56") as this will never change
Thank you