Excel-stock calculation macro
I have an excel sheet which has columns- Item name, cost price, selling price, profit, buying price, no of articles sold, no of items bought etc.. If I purchase an item, I make an entry in a row with values only in Item name, buying price and no of articles bought. It I sell an article, I make an entry in the item name, no of items sold, cost price, selling price and profit. In another worksheet, I am maintaining the stock. If 10 pieces of item A are bought and 8 are sold, there should be an entry made in the 2nd workbook saying 2 items of type A are available. The sales and purchasing of the items is random.. i.e. the item A can b bought first with an entry in the 1st row, the item B can b sold with an entry in 2nd row and then Item A can b sold with an entry in the 3rd row. Please help me in writing a macro for this.plsss