Would you please try this one and let me know if that is right?
Cheers,
Vlad
Would you please try this one and let me know if that is right?
Cheers,
Vlad
Great to hear, good luck with your project!
Cheers,
HI Gicu,
I need your help again regarding an improvement to the current macro as currently it only accepts one input for the frequency spec. can we make it such that it accepts 2 inputs example (-2 ,-4) and it will do the pairing between this range of frequency spec starting with -4 then -3 then -2?
current input by users
example of 2 inputs by users outcome result, it will pair with the -4 first then -3 and then -2. another example would be like user input (-1,1) so it will pair -1 then 0 then 1 which will be in this case of using 385 khz as example would be 384 then 385 then 386. is this possible for having user input 2 values and we do the pairing according to the range of the values? thanks again for the help . do let me know if you need more information.
![]()
Please have a look and let me know if that is what you wanted. Enter ranges like this: -4,-2
Hi Gicu,
Sorry for the late reply, it seems the logic is abit different after i tested. below is an example of the output that should come out of the ranges .
If enter the range -4,-2
It should pair in a way like below
It starts with 374khz but as there is no frequency with quantity to pair within the range of -4,-2 it will skip it and move to the next frequency which has quantity.
Next available frequency with quantity would be 378khz. So doing the first number of the range which is -4 we would get 374khz which we are able to pair up thus minus the quantity for 374khz which will become 0 and 378khz left with 1 quantity. As for the range -3 it would be 375khz but there is no quantity available this it will skip and move to range -2 which is 376khz which also has no quantity available for pairing thus the pairing for this frequency 378khz is finished with remaining 1 qty.
pic1
Next it will move to 379khz and try to pair with -4 range which is 375khz with no quantity thus skip and move to -3 range which is 376khz with no quantity and skip to -2 range which is 377khz which is also no quantity thus ends for this frequency pairing for 379khz
pic2
Next frequency in line will be 380khz. For range -4 will be 376khz with no quantity thus skip, range -3 will be 377khz with no quantity thus skip too, range -2 will be 378khz which has quantity 1 left as we can see from pic 1 thus able to pair up with 380khz.
pic3
So now we have 2 successful pairings. One is 378khz with 374khz and 380khz with 378khz. It should continue pairing until there is no more available frequency.
![]()
Please have a look at the code to see what I did. It simply does the entire pairing on all the integers in the range you enter just like it did before. So first it does the -4 (for all records), then it resets the quantities and does the -3 and finally -2. I added the "Input" field to both detail and summary tables so you know which iteration match the pair. Are you saying that you want instead to check for each frequency all items in range (first -4 then -3 then -2) without resetting quantities between values?
Cheers,
Vlad
Hi Vlad,Please have a look at the code to see what I did. It simply does the entire pairing on all the integers in the range you enter just like it did before. So first it does the -4 (for all records), then it resets the quantities and does the -3 and finally -2. I added the "Input" field to both detail and summary tables so you know which iteration match the pair. Are you saying that you want instead to check for each frequency all items in range (first -4 then -3 then -2) without resetting quantities between values?
Cheers,
Vlad
Yes what i mean is that it will check each frequency all the items in the range without resetting the quantities between the range values. so for example each frequency example 378khz it will go through the -4 (374khz) then -3(375khz) then -2(376khz) if there are quantities available it will pair with 379khz and minus the quantity like it did before. after it finishes the range -2 it will then loop and move to the next frequency in line without resetting the quantities which is 379khz and repeat the loop again of range -4(375khz), -3(376khz),-2(377khz) and so on.
Last edited by kishino; 08-17-2020 at 10:56 AM.
Please have a look now. I am not sure I get what you want. Initially it was looping from the input to 0, (so if you entered 3 it will look for 3 then 2 then 1), and now you want it to stop at the end of the range (so for -4,-2 would do -4 then -3 then -2 and stop, not go all the way to 0).
CHeers,
Hi Vlad,Please have a look now. I am not sure I get what you want. Initially it was looping from the input to 0, (so if you entered 3 it will look for 3 then 2 then 1), and now you want it to stop at the end of the range (so for -4,-2 would do -4 then -3 then -2 and stop, not go all the way to 0).
CHeers,
Yes seems like in the right direction already. but the data outcome is kinda short or it miss one one the freq to pair up. i did it manually with the range (-4,-2) and the output pairs should be like below.
from your module it comes out like this instead. its skipping some of the pairs in between if you compare the 2 outputs.i edited the file so that it starts from the highest freq then it pairs downwards.
pairing_Aug_21_2020.zip
Hi, please try this one and let me know, I think it matches your manual example.
Cheers,
Vlad
Glad to hear, good luck with your project!
Cheers,