欢迎来到天天文库
浏览记录
ID:38878348
大小:15.90 KB
页数:13页
时间:2019-06-20
《VBA自动处理报表源码》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、SubCombineWorkbooks()DimFilesToOpen,ftDimxAsIntegerApplication.ScreenUpdating=FalseOnErrorGoToerrhandlerFilesToOpen=Application.GetOpenFilename_(FileFilter:="MicrsofeExcel文件(*.xls),*.xls",_MultiSelect:=True,Title:="要合并的文件")IfTypeName(FilesToOpen)="boolean"ThenMsgBox"没有选定文件
2、"'GoToerrhandlerEndIfx=1Whilex<=UBound(FilesToOpen)Setwk=Workbooks.Open(Filename:=FilesToOpen(x))wk.Sheets().Moveafter:=ThisWorkbook.Sheets_(ThisWorkbook.Sheets.Count)x=x+1WendMsgBox"合并成功完成!"errhandler:'MsgBoxErr.Description'ResumeerrhandlerEndSubSubMacroC1()''MacroC1Macro
3、''Sheets("报表1-MME容量及业务量报表").SelectRange("D6").SelectActiveCell.FormulaR1C1="=D5/10000"Range("D6").SelectActiveCell.FormulaR1C1="=R[-1]C/10000"Range("D6").SelectSelection.NumberFormatLocal="0.00"Selection.CopySheets("Sheet1").SelectRange("C1").SelectSelection.PasteSpecialPa
4、ste:=xlPasteValuesAndNumberFormats,Operation:=_xlNone,SkipBlanks:=False,Transpose:=FalseEndSubSubMacroC2()''MacroC2Macro''Sheets("报表1-SGSN性能报表").SelectRange("F41").SelectApplication.CutCopyMode=FalseActiveCell.FormulaR1C1="=SUM(R[-37]C:R[-1]C)"Range("F42").SelectActiveCell
5、.FormulaR1C1="=R[-1]C[-2]/10000"Range("F42").SelectActiveCell.FormulaR1C1="=R[-1]C/10000"Range("F42").SelectSelection.NumberFormatLocal="0.00"Selection.CopySheets("Sheet1").SelectRange("C2").SelectSelection.PasteSpecialPaste:=xlPasteValuesAndNumberFormats,Operation:=_xlNon
6、e,SkipBlanks:=False,Transpose:=FalseEndSubSubMacroC4()''MacroC4Macro''Sheets("报表1-PGW业务量报表").SelectRange("F77").SelectApplication.CutCopyMode=FalseActiveCell.FormulaR1C1="=SUM(R[-70]C:R[-1]C)-R[-61]C"Range("F78").SelectActiveCell.FormulaR1C1="=R[-1]C/10000"Range("F78").Sel
7、ectSelection.NumberFormatLocal="0.00"Selection.CopySheets("Sheet1").SelectRange("C4").SelectSelection.PasteSpecialPaste:=xlPasteValuesAndNumberFormats,Operation:=_xlNone,SkipBlanks:=False,Transpose:=FalseEndSubSubMacroC5()''MacroC5Macro''Sheets("报表1-GGSN性能报表").SelectColumn
8、s("I:I").SelectRange("I3").ActivateActiveWindow.SmallScrollDown:=30Range("I43").SelectApp
此文档下载收益归作者所有