Hi all,
Have some code I'm struggling with. Basically I have prices/values in column M. There will be a number of different prices in the column but for every row that has price X in column M, I need all cells in the same row of Column K to have the same text (these will be months written in general format) as each other and all cells again in the same row of Column I to net to zero - for column i I already have the positive and negative values using another bit of code so it will be a simple sum all line to make sure the net value is 0.
Essentially overall I need it code that checks below are all matching with IF function and moves on once matching. So for example, I want the code to go to column M and check for X (e.g 45) and if the the contract months in the adjacent rows in Column K are both matching with price X then it moves to Column I and checks the buy/sells for that contract and that price all net to 0. Normally these will match on my check but I need a loop whereby it checks price X has same contracts and net flat on buys/sells then if ok moves to price Y etc until all done. The tricky part is that prices can also be out so if for example one of the 45 prices was 47 in error I want the code to stop the loop and notice that buys/sells are flat, contracts match but a price is out. So essentially any of the 3 economics can be wrong. I simply need a check error message for any one of the possible faults if one is out (which I can do), I do not need any correction in the code. I have already removed extra text from the price column to leave only values and have made the sells negative so that I can sum to zero but am stuck with how to check all the 3 columns against each other. Any help much appreciated.
Buy/Sell Contract Price
10 Nov 20 45
-10 Nov 20 45
20 Dec 20 50
-20 Dec 20 50
30 Jan 21 55
-30 Jan 21 55
Have some code I'm struggling with. Basically I have prices/values in column M. There will be a number of different prices in the column but for every row that has price X in column M, I need all cells in the same row of Column K to have the same text (these will be months written in general format) as each other and all cells again in the same row of Column I to net to zero - for column i I already have the positive and negative values using another bit of code so it will be a simple sum all line to make sure the net value is 0.
Essentially overall I need it code that checks below are all matching with IF function and moves on once matching. So for example, I want the code to go to column M and check for X (e.g 45) and if the the contract months in the adjacent rows in Column K are both matching with price X then it moves to Column I and checks the buy/sells for that contract and that price all net to 0. Normally these will match on my check but I need a loop whereby it checks price X has same contracts and net flat on buys/sells then if ok moves to price Y etc until all done. The tricky part is that prices can also be out so if for example one of the 45 prices was 47 in error I want the code to stop the loop and notice that buys/sells are flat, contracts match but a price is out. So essentially any of the 3 economics can be wrong. I simply need a check error message for any one of the possible faults if one is out (which I can do), I do not need any correction in the code. I have already removed extra text from the price column to leave only values and have made the sells negative so that I can sum to zero but am stuck with how to check all the 3 columns against each other. Any help much appreciated.
Buy/Sell Contract Price
10 Nov 20 45
-10 Nov 20 45
20 Dec 20 50
-20 Dec 20 50
30 Jan 21 55
-30 Jan 21 55