I don't think you need to use VBA to solve your problem...
I would use two columns to the right of your data to keep a running total based
on whether "buy" or "sell" is used.
I know I'm not supposed to use attachments but it would be hard to explain so
I've given an example here:
P.S. THERE IS NO CODE IN THIS ATTACHMENT!!!
(See attached file: Example.xls)