I work in VBA.
Please keep it simple.
Code:If WScript.Arguments.Count < 2 Then WScript.Echo "Error! Please specify the MATCH to delete Sheet and the file to edit. Usage: wscript xlsDeleteSheetIfContains.vbs searchString SourcePath.xls" Wscript.Quit End If on error resume next set wb=getobject(WScript.Arguments(1)) wb.application.displayalerts=false for each sh in wb.sheets sh.cells.find(WScript.Arguments(0),,,1).clearcontents if err.number=0 then sh.delete err.clear next wb.close true set wb=nothing




Reply With Quote
Bookmarks