4操作工作簿
Workbooks工作簿
for each (for的另一种形式)
For Each ge In Range("a1:a10") i = i + 1 ge = i Next
Esc停止执行代码
打开文件Open:
Workbooks.Open Filename:= ActiveWorkbook.Sheets().Range() =
成对使用取消屏幕显示的多余的东西
Application.DisplayAlerts = False Application.ScreenUpdating = False ... Application.DisplayAlerts = True Application.ScreenUpdating = True
实例: 打开文件
shi() Application.DisplayAlerts = Application.ScreenUpdating = Workbooks.Open Filename:= ActiveWorkbook.Sheets().Range() = ActiveWorkbook.Save ActiveWorkbook.Close Application.DisplayAlerts = Application.ScreenUpdating =
Add 新建工作簿
Workbooks.Add ActiveWorkbook.Sheets().Range() = ActiveWorkbook.SaveAs Filename:= ActiveWorkbook.Close
把一个表拆分多个文件
sht Worksheet sht Sheets sht.Copy ActiveWorkbook.SaveAs Filename:= sht.Name ActiveWorkbook.Close
上节课的作业易错点:
先点表(Sheet(j).select),再点单元格(Sheet(j).Range("d" & i).select)