修正方法

これのスクリプトを修正

↓スクリプトの「指定された列を削除する」のところを以下の赤字のように修正
' ====指定されたファイルを開く====================================================
' ファイルのパスをフルパスに変換する
fname = !ファイル名!
SetUMSVariable "$FILE_PATH_TYPE", "1"
SetUMSVariable "$PARSE_FILE_PATH", fname
filePath = GetUMSVariable("$PARSE_FILE_PATH")
If filePath = "" Then
Err.Raise 1, "", "指定されたファイルを開くことができません。"
End If
' workbookオブジェクトを取得する
Set workbook = Nothing
On Error Resume Next
' 既存のエクセルが起動されていれば警告を抑制する
Set existingXlsApp = Nothing
Set existingXlsApp = GetObject(, "Excel.Application")
existingXlsApp.DisplayAlerts = False
Set wash = CreateObject("WinActor7.ScriptHelper")
For Each book in wash.GetExcelWorkbooks
SetUMSVariable "$FILE_PATH_TYPE", 0
SetUMSVariable "$PARSE_FILE_PATH", book.FullName
bookPath = GetUMSVariable("$PARSE_FILE_PATH")
If StrComp(bookPath, filePath, 1) = 0 Then
Set workbook = book
Set xlsApp = workbook.Parent
xlsApp.Visible = True
Exit For
End If
Next
Set wash = Nothing
' Workbookが存在しない場合は、新たに開く。
If workbook Is Nothing Then
Set xlsApp = Nothing
' Excelが既に開かれていたならそれを再利用する
If Not existingXlsApp Is Nothing Then
Set xlsApp = existingXlsApp
xlsApp.Visible = True
Else
Set xlsApp = CreateObject("Excel.Application")
xlsApp.Visible = True
End If
Set workbook = xlsApp.Workbooks.Open(filePath)
End If
' 警告の抑制を元に戻す
existingXlsApp.DisplayAlerts = True
Set existingXlsApp = Nothing
On Error Goto 0
If workbook Is Nothing Then
Err.Raise 1, "", "指定されたファイルを開くことができません。"
End If
' ====指定されたシートを取得する==================================================
sheetName = !シート名!
Set worksheet = Nothing
On Error Resume Next
' シート名が指定されていない場合は、アクティブシートを対象とする
If sheetName = "" Then
Set worksheet = workbook.ActiveSheet
Else
Set worksheet = workbook.Worksheets(sheetName)
End If
On Error Goto 0
If worksheet Is Nothing Then
Err.Raise 1, "", "指定されたシートが見つかりません。"
End If
worksheet.Activate
' ====指定された列を削除する==================================================
' 削除する列を配列として扱う
deleteColumns = Split(!削除列!, ",")
' 列を降順にソート(後ろの列から削除するため)
For i = 0 To UBound(deleteColumns) - 1
For j = i + 1 To UBound(deleteColumns)
If CInt(Trim(deleteColumns(i))) < CInt(Trim(deleteColumns(j))) Then
temp = deleteColumns(i)
deleteColumns(i) = deleteColumns(j)
deleteColumns(j) = temp
End If
Next
Next
' 各列を削除
For Each col In deleteColumns
colNum = CInt(Trim(col))
worksheet.Columns(colNum).Delete
Next
Set objRe = Nothing
Set xlsApp = Nothing
Set worksheet = Nothing
Set workbook = Nothing
使い方
削除したい列をいくつでも列番号で数字でカンマ区切り

以上