Private Sub Command7_Click()
Dim EXAPP As Excel.Application
Dim WB As Excel.Workbook
Dim sht As Excel.Worksheet
Set EXAPP = CreateObject("excel.application")
Set WB = EXAPP.Workbooks.Open("d:\成绩表.xls")
Set sht = WB.Worksheets("总表")
sht.Rows("2:2").Select
sht.Range("C2").Activate
sht.Range("C2").AutoFilter
sht.Range("C2").AutoFilter Field:=5, Criteria1:="1"
Sheets("成绩表").Activate[/color]
Sheets.Add
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "1"
Sheets("总表").Select
Cells.Select
Selection.Copy
Sheets("1").Select
Cells.Select
ActiveSheet.Paste
Cells.Select
Sheets("总表").Select
Rows("2:2").Select
Application.CutCopyMode = False
Selection.AutoFilter
红色部分出错!!,我也不知道,这里是选择成绩表,但是就是提示错误!就是成绩表那里出错了!
[
本帖最后由 lx5656 于 2015-5-20 17:34 编辑 ]