function moveData(from, to) { for (x = 2; x <= Right; x++) { [x,to] = [x,from]; [x,from] = ""; } } function findData(key, from) { for (y = from; y <= Bottom; y++) { if ([2,y] == key) { return y; } } return 0; } for (y = 1; y <= Bottom; y++) { if ([1,y] != "" && [1,y] != [2,y]) { moveData(y, Bottom + 1); found = findData([1,y], y + 1); if (found != 0) { moveData(found, y); if ([1,found] == "") { DeleteRow(found); } } } }