Please some1 tell me this one 2 - last one i need V URGENT!

Sami

Board Regular
Joined
Mar 4, 2002
Messages
122
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!?!?!?
 
Sami

Can i request you postt your amended codes, to what i discribed, ill help, but i wil not post the code answer you need to do that, i and i have spoken to few guys all will help you and agree your studying and so we will help and assist, but two guys i spoke with in London today agree you need to understand your work

What if teacher askes to explain that code?? If you dont know they will know you have had help, or i or someone presented you pass, but you could fail on techi issues, WE do not want that!

Post you code, i have re read you codes above and they do not make sence and will not run....

tidy them and post i / we will look at them and advise.

the then if.. did this work, did you try?
 
Upvote 0

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,214,630
Messages
6,120,634
Members
448,973
Latest member
ChristineC

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top