function moveRow(from, to) { if (from == to) { return; } InsertRow(to); if (from > to) { from++; } for (x = 1; x <= Right; x++) { [x,to] = [x,from]; } DeleteRow(from); } x = InputBox("列番号を入力してください。"); if (x == "") { return; } keys = InputBoxMultiLine("並び替えるデータを改行区切りで入力してください。"); nextRow = 1; while (keys != "") { p = pos(keys, "\n"); if (p > 0) { key = left(keys, p - 1); keys = mid(keys, p + 1); } else { key = keys; keys = ""; } for (y = nextRow; y <= Bottom; y++) { if ([x,y] == key) { moveRow(y, nextRow); nextRow++; } } }