Hi all,
So when I input a previous PO number under PO# (Circled in red) I want it to pull all my data through into the correct cells from my data base on sheet 2 'PO List'.
Everything is working Supplier, Reference, Description etc.... bar the delivery address where instead of inputting the data into the cells (F9 & F10), it clears it from the database on sheet 2.
Please see the code below:
Sub PO_SaveUpdate()
Dim PORow As Long, POItemRow As Long, LastItemRow As Long, ItemRow As Long
With Sheet1
'Determine if New or Existing PO
If .Range("B5").Value = True Then 'New
PORow = Sheet2.Range("A99999").End(xlUp).Row + 1 'First AvailRow
.Range("H3").Value = .Range("B7").Value 'Next PO #
Sheet2.Range("A" & PORow).Value = .Range("H3").Value 'PO#
Else 'Existing PO
PORow = .Range("B4").Value 'Purchase Order Row
End If
Sheet2.Range("B" & PORow).Value = .Range("H4").Value 'PO Date
Sheet2.Range("C" & PORow).Value = .Range("H5").Value 'Status
Sheet2.Range("D" & PORow).Value = .Range("D9").Value 'Vendor
Sheet2.Range("E" & PORow).Value = .Range("F9").Value 'Del.Add1
Sheet2.Range("F" & PORow).Value = .Range("F10").Value 'Del.Add2
thanks for your help in advance.
Abi
So when I input a previous PO number under PO# (Circled in red) I want it to pull all my data through into the correct cells from my data base on sheet 2 'PO List'.
Everything is working Supplier, Reference, Description etc.... bar the delivery address where instead of inputting the data into the cells (F9 & F10), it clears it from the database on sheet 2.
Please see the code below:
Sub PO_SaveUpdate()
Dim PORow As Long, POItemRow As Long, LastItemRow As Long, ItemRow As Long
With Sheet1
'Determine if New or Existing PO
If .Range("B5").Value = True Then 'New
PORow = Sheet2.Range("A99999").End(xlUp).Row + 1 'First AvailRow
.Range("H3").Value = .Range("B7").Value 'Next PO #
Sheet2.Range("A" & PORow).Value = .Range("H3").Value 'PO#
Else 'Existing PO
PORow = .Range("B4").Value 'Purchase Order Row
End If
Sheet2.Range("B" & PORow).Value = .Range("H4").Value 'PO Date
Sheet2.Range("C" & PORow).Value = .Range("H5").Value 'Status
Sheet2.Range("D" & PORow).Value = .Range("D9").Value 'Vendor
Sheet2.Range("E" & PORow).Value = .Range("F9").Value 'Del.Add1
Sheet2.Range("F" & PORow).Value = .Range("F10").Value 'Del.Add2
thanks for your help in advance.
Abi