ive got this macro:
Sub EnterAnotherSale()
'
' EnterAnotherSale Macro
' Enters another sale into the system
'
Rows("5:5").Select
Selection.Insert Shift:=xlDown
Range("F5").Select
ActiveCell.FormulaR1C1 = "=RC[-2]*RC[-1]"
Range("A5").Select
'Look for the ProductID in the Stock Table.
StockWorkbook.Seek "=", ProductID
'When found, take the current quantity and subtract from it the sold quantity.
If Not StockWorkbook.EOF Then
StockWorkbook.Edit
StockWorkbook!Quantity = StockWorkbook!Quantity - SalesWorkbook!Quantity
StockWorkbook.Update
'
End Sub
But the bit 'Look for the ProductID in the Stock Table.
StockWorkbook.Seek "=", ProductID
'When found, take the current quantity and subtract from it the sold quantity.
If Not StockWorkbook.EOF Then
StockWorkbook.Edit
StockWorkbook!Quantity = StockWorkbook!Quantity - SalesWorkbook!Quantity
StockWorkbook.Update
needs to run AFTER all the sale data has been entered and enter has been pressed in CELL F5. Plz can you give me the intermidiate code!?!?!?
Sub EnterAnotherSale()
'
' EnterAnotherSale Macro
' Enters another sale into the system
'
Rows("5:5").Select
Selection.Insert Shift:=xlDown
Range("F5").Select
ActiveCell.FormulaR1C1 = "=RC[-2]*RC[-1]"
Range("A5").Select
'Look for the ProductID in the Stock Table.
StockWorkbook.Seek "=", ProductID
'When found, take the current quantity and subtract from it the sold quantity.
If Not StockWorkbook.EOF Then
StockWorkbook.Edit
StockWorkbook!Quantity = StockWorkbook!Quantity - SalesWorkbook!Quantity
StockWorkbook.Update
'
End Sub
But the bit 'Look for the ProductID in the Stock Table.
StockWorkbook.Seek "=", ProductID
'When found, take the current quantity and subtract from it the sold quantity.
If Not StockWorkbook.EOF Then
StockWorkbook.Edit
StockWorkbook!Quantity = StockWorkbook!Quantity - SalesWorkbook!Quantity
StockWorkbook.Update
needs to run AFTER all the sale data has been entered and enter has been pressed in CELL F5. Plz can you give me the intermidiate code!?!?!?