0

行 1 に必要なテキストが含まれていない Excel の列を削除する AppleScript が必要です。行 1 に「REC_ID、F_STATUS、または EVENT_ID」を含む列を削除するスクリプトを以下に示します。

set myValues to "REC_ID, F_STATUS, EVENT_ID"
tell application "Microsoft Excel"
set columnCount to (((count of columns of used range of active sheet)) + 1)
repeat with i from columnCount to 1 by -1
    set cellValue to value of cell ("1" & i)
    if cellValue is not in myValues then
        delete column i
    end if
end repeat
end tell

セル「133」の値から、「Microsoft Excel でエラーが発生しました: アクセスしようとしているオブジェクトが存在しません」というエラーが表示され続けます。番号 -1728 です。

助けてくれてありがとう!

4

1 に答える 1

0

私はあなたの行を変更しました:

set cellValue to value of cell ("1" & i)

これに:

set cellValue to value of row 1 of column i

..これで修正されたようです。

于 2013-06-09T15:27:51.947 に答える