|
打开工作簿:Sub OpenWorkBook1() Workbooks.Open FileName:="c:tempWelcome.xls"End Sub关闭工作簿Sub CloseAllWorkBook() Workbook.closeEnd SubSub CloseWorkBook1() Workbooks("Welcome.xls").CloseEnd SubSub CloseSaveBook1() Workbooks("Welcome.xls").Close SaveChanges:=TrueEnd Sub将已打开的工作簿设定为活动工作簿Sub ChangeActiveWindow() Windows("Welcome.xls").ActivateEnd Sub保存工作簿Sub SaveActiveWorkbook() ActiveWorkbook.SaveEnd Sub新建工作簿Sub CreateWorkSheet1() Worksheets.AddEnd Sub选取工作簿Sub ActiveWorkSheet2() Worksheets("Sheet3").SelectEnd Sub选取单元格内容Sub RangeSelect1() Range("B5").Select 或Range("A1:D5").SelectEnd Sub显示单元格内容Sub UseMsgBox() MsgBox Range("A1").ValueEnd Sub |
|