BOAO Inventory export Excel after unit bulk substitution

Source: Internet
Author: User

BOAO List V17, the number of units square meters and cubic meters are superscript display. In order to make it easy to distinguish after printing, you should change it to "M2" and "M3" after exporting Excel, as required by your boss.

VBS BULK CODE Modification:

Option ExplicitIfWscript.Arguments.Count =0  ThenWScript.EchoChr(Ten) & _    "[correct operation]"&Chr(Ten) &Chr(Ten) & _    Chr(9) &"drag and drop an exported Excel file into this program"&Chr(Ten) &Chr(Ten) & _    "[Error Action]"&Chr(Ten) &Chr(Ten) & _    Chr(9) &"Double-click this program"Wscript.QuitEnd IfDimXlsfilepathxlsfilepath=wscript.arguments (0)DimWshellSetWshell=CreateObject("Wscript.Shell")If LCase( Right(Wscript.fullname, One)) ="Wscript.exe"  ThenWshell.run"CScript.exe//nologo"& _    Chr( +) & _    Chr( the) & Wscript.scriptfullname &Chr( the) & _    Chr( +) & _    Chr( the) & WScript.Arguments (0) &Chr( the) Wscript.QuitEnd IfWScript.Echo"running, please wait ..."DimOexcel,oworkbook,sheet on Error Resume NextSetoexcel =GetObject(,"Excel.Application")IfErr ThenWScript.Echo Err.Description Err.ClearSetoexcel =CreateObject("Excel.Application") oexcel.visible=FalseEnd IfSetOworkbook =OExcel.Workbooks.Open (Xlsfilepath)IfErr ThenErr.Clear wshell.popup"The specified file could not be opened for the following possible reasons:"&Chr(Ten) & _    "1. Microsoft Office 2003, 2007, 2010, or later versions are not installed on this computer. "&Chr(Ten) & _    "2. Files that need to be processed are open or occupied by other programs, please close the file and re-use the program. ",Ten,"Tips", -+4096Wscript.QuitEnd If on Error Goto 0Oexcel.displayalerts=FalseDimCurrentpathcurrentpath=CreateObject("Scripting.FileSystemObject"). GetFile (Wscript.scriptfullname). Parentfolder.path for  eachSheetinchoworkbook.worksheets sheet.activate WScript.Echo"Replace:"&sheet.name OExcel.Cells.Replace"㎡","m2",2,1,False,False,FalseOExcel.Cells.Replace"","m2",2,1,False,False,FalseOExcel.Cells.Replace"","M3",2,1,False,False,FalseOExcel.Cells.Replace"Extended Rice","m",2,1,False,False,FalseNextOworkbook.worksheets (1). SelectoWorkbook.SaveoExcel.DisplayAlerts=TrueOworkbook.closeSetoexcel = NothingSetOworkbook = NothingWshell.popup"after a period of bloody battle, finally took care of all the unit replacement. ",Ten,"Boao Unit Replacement", -

BOAO Inventory export Excel after unit bulk substitution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.