Excelファイルをsheet毎に別ファイルに分割。したい日もある。
を10行位、で。
split_book.vbs
| Set FSO = CreateObject("Scripting.FileSystemObject")
file = WScript.Arguments(0)
With CreateObject("Excel.Application")
Set book = .WorkBooks.Open(file)
For Each sheet In book.WorkSheets
sheet.Copy
With .WorkBooks(.WorkBooks.Count)
.SaveAs FSO.BuildPath( _
FSO.GetParentFolderName(file), sheet.Name & ".xls")
.Close
End With
Next
book.Close
.Quit
End With
|
くらいでどうでしょうか。役だった?
作成日 2008-09-11 (木) 15:53:14
Tag: WSH 10行くらい