cols = InputBox("更新する列を指定してください。"); cols = replace(cols, " ", ""); if (cols == "") { MessageBox("キャンセルしました。"); return; } // 各行をループ for (y = 2; y <= Bottom; y++) { rest = cols; // 入力データを処理し終わるまでループ while (rest != "") { // 「,」で区切る。以降は最初の区画を処理。 p1 = pos(rest, ","); if (p1 > 0) { current = left(rest, p1 - 1); rest = mid(rest, p1 + 1); } else { current = rest; rest = ""; } // 「-」で区切る。 p2 = pos(current, "-"); if (p2 > 0) { x1 = int(left(current, p2 - 1)); x2 = int(mid(current, p2 + 1)); } else { x1 = int(current); x2 = x1; } // 対象の列を処理 for (x = x1; x <= x2; x++) { if ([x,y] == "") { [x,y] = [x,y-1]; } } } }