Macro for loss/gain per sale

Hi, I have a spreadsheet with several trades for a stock (sorted by FIFO). Can anyone help with a macro that can calculate loss/gain per sale in a column?