VBS脚本
程序员文章站
2022-03-04 20:30:22
...
实现功能:对于classes1.xlsx、classes2.xlsx、classes3.xlsx、classes4.xlsx、classes5.xlsx五个班级的学生总分的相加;
dim eapp, ebook, esheet,i,j,r
set eapp=CreateObject("excel.application")
for i=1 to 5
set ebook=eapp.workbooks.open(("F:\学习\vbs\classes"& i)&".xlsx")
for each esheet in ebook.sheets
esheet.range("G1").Value = "总分"
for r = 2 To 7
esheet.cells(r,7).value = esheet.cells(r,2).value + esheet.cells(r,3).value + esheet.cells(r,4).value +esheet.cells(r,5).value+esheet.cells(r,6).value
next
next
ebook.save
ebook.close
set ebook = Nothing
next
eapp.quit
set eapp = nothing
上一篇: vbs更新
下一篇: 用cmd写python怎么换行