hi everyone,
new here and need help with a macro,
i need a macro to delete any row with numbers which doesn't have a difference of 1 AND 2 by an array of predefined numbers
example:
array: 1-2-3-3
check numbers: 6-7-7-8 or 5-7-7-8
explaintion: the difference between highest number in the array is 3 and the lowest in the "check numbers" is 6 (for 6-7-7-8) so lowest difference is 3 so it need to deleted
AND for "check numbers" 5-7-7-8 lowest one is 5 and there's only a 1 difference (of 2) but not 2 differences (1+2) so that also need to deleted
BUT IF the numbers in "check numbers" will be 4-5-6-7 then difference between highest in the array and lowest in "check numbers" will be 1 and 2 (4-3=1 and also 4-2=2 or 5-3=2) so it need to stay
thank you !
here's an example data
column e is just for showing which lines to delete
any line without the number 3 = in red need to get deleted
(3 indicates there's difference of 1 and 2, 2 indicates of only difference of 2, 1 of only difference of 1, 0 = no difference of either 1 or 2)
Bookmarks