asked on
maximum of "X" numbers from same "deci".
There should be:
1) a prompt would ask for input of "Maximum numbers allowed from same deci" or something similar. If the input is one (1) then
2) ask to click on any cell that contains numbers to be processed then
3) sheet "Numbers_3" would be edited as follows:
This process should be able to be repeated for any sheet similar to "Numbers_3"
The picture shows items in RED that should be removed they all contain more than one number from the same deci. The sample numbers that should remain are 3, 7, 10, 20, 30 since only 3 and 7 are from same deci. 3, 7, 10, 20 and 29 are shown red since it contains 3 and 7 from same deci plus 20 and 29 from same deci. Thus it does not meet the criteria.
AllowMax_X_fromsameDeci.xlsm
ASKER
I had to use a different file. Apparently it did not allow my original due a max 50MB per file.
Please make a separate script for this since I'd like to run it separate from any other scripts.
And by the way did you try the updated file that I posted in your previous question? It's an xlsb file.
ASKER
No, this one should be fine since we only need to test on one worksheet and it contains the same data I have for the first sheet and second sheets.
Yes. It worked as intended for the full set after editing as you specified. Thank You!
2) ask to click on any cell that contains numbers to be processed then
this?
2) ask to activate (select) one of the Numbers_n sheets that contains numbers to be processed then
ASKER
Re-embedded the picture. I can see the file and the picture.
Either will work as long as it processes items on one (1) sheet at a time and only for the "selected sheet"
29173241.xlsb
ASKER
Martin,
It does seem to work but partly. The image below shows some of the same numbers in the original post that should have been removed but are still there after processing. Anything in red or anything similar should not be there after the script is run on a sheet.
Also, I expected it to ask how many "deci's" to remove. I assume you set it at one. Hence, these reds should not be there. Notice that there are two numbers from the 1-9 range and two from the 10-19 range.
There are many items besides these that should also be removed.
29173241a.xlsb
ASKER
Runs much faster at 5 minutes versus 12 minutes previously. But,
1) I got an error even when I ran it on sheet 3 and sheet 7
After I clicked 'Ok" is seems to run as intended. It should be removed without affecting results. Otherwise, it can stay there.
2) The "Maximum in Deci" pop up needs adjusting. The default is "2" which led me to believe that it would allow 2 from any deci. However, it seems to allow only 1. When I change it to 1 it allows zero per deci. This can get confusing. I'd Like to adjust that variable so it's input follows the logic static in my original post.
Otherwise, it seems to perform as intended.
Pedro.xlsb
ASKER
Martin,
I ran code "RemoveInvalidDecis" since there were more than 1.
It seems this script targets more than one number from "same deci" as in my original post. which means it does what was originally intended. I also added additional and it targeted those as well. I colored in orange in the picture below.
Is there any way to alter the input to match the number of "decis" in the output? In other words, now "2" keeps two number from same deci but it should be "one pair" from same deci as the default. I hope I explained it so you can understand.
ASKER
My apologies. If this script works as intended if run on the full combinations, then this question can be closed. I’ll address the other in a different question once I see the results from this script.
let me see the results when you fell you’ve got it done.