Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function DupeDestroyX(range,a,b,index) {
- var j = index-1 || 0;
- for(var i=0;i<(range.length-1);i++){ //loop over all entries
- try {
- if(range[i][j]==a && range[i+1][j]==a) { // if current entry is a and next entry is also a
- range.splice(i,1); // delete current entry
- if (range[i+1][j]==a) {i--} //If next entry is also a (after deleting),loop repeat this iteration
- }
- if(range[i][j]==b && range[i+1][j]==b) {
- range.splice(i+1,1); //delete next entry
- if (range[i+1][j]==b) {i--}
- }
- }
- catch(e) {continue;}
- }
- return range;
- }
- =DupeDestroyX(A1:C,"a","b")
Add Comment
Please, Sign In to add comment