function addComma(str) { // 小数点以降には「,」をつけない point = pos(str, "."); if (point > 0) { length = point - 1; } else { length = len(str); } // 先頭の「-」には「,」をつけない if (left(str, 1) == "-") { sign = 1; } else { sign = 0; } // 小数点の位置から「-」の位置まで 3 桁区切りで「,」を挿入 for (p = length - 3; p > sign; p = p - 3) { str = left(str, p) + "," + mid(str, p + 1); } return str; } InsertCol(8); for (y=3; y<=Bottom; y++) { [8,y] = addComma([4,y] / [6,y]); } AdjustColWidth(8);