str1 = InputBox("検索文字列を入力してください"); if (str1 == "") { return; } str2 = InputBox("置換文字列を入力してください"); count = 0; for (y = 1; y <= Bottom; y++) { for (x = 1; x <= Right; x++) { if (pos([x,y], str1) > 0) { [x,y] = replace([x,y], str1, str2); count++; } } } MessageBox(count + "件置換しました");