Hello,
After so many years of saying that there was no need to use VBA, I think I've reached my breaking point. Any help will be greatly appreciated!
Being a beginning at VBA, can someone please assist?
I am trying to calculate the sum of a string of products under certain limitations. This is what I need to do:
Transaction Currency = User Defined
Buy Units = User DefinedCloseValue = 0
RemainingUnits = Buy Units
1. Find Sell Order of Same Currency
2. RemainingUnits > Sell Units?
True:
SellValue = (Sell Units * Sell Price for Transaction)
CloseValue = CloseValue + SellValue
SellValue = 0
- RemainingUnits = (Buy Units - Sell Units)
- Return to Step 1
False: 0 < Sell Units < Buy Units
SellValue = (Sell Units * Sell Price)
CloseValue = CloseValue + SellValue
Stop
Output = CloseValue before stop
I would then need this to repeat in the cell below so that it will not pick up any of the prior sell transactions.
Thank you for any help
After so many years of saying that there was no need to use VBA, I think I've reached my breaking point. Any help will be greatly appreciated!
Being a beginning at VBA, can someone please assist?
I am trying to calculate the sum of a string of products under certain limitations. This is what I need to do:
Transaction Currency = User Defined
Buy Units = User DefinedCloseValue = 0
RemainingUnits = Buy Units
1. Find Sell Order of Same Currency
2. RemainingUnits > Sell Units?
True:
SellValue = (Sell Units * Sell Price for Transaction)
CloseValue = CloseValue + SellValue
SellValue = 0
- RemainingUnits = (Buy Units - Sell Units)
- Return to Step 1
False: 0 < Sell Units < Buy Units
SellValue = (Sell Units * Sell Price)
CloseValue = CloseValue + SellValue
Stop
Output = CloseValue before stop
I would then need this to repeat in the cell below so that it will not pick up any of the prior sell transactions.
Thank you for any help