回复 楼主 start1901
补充上完整代码
第一个按钮:
Private Sub Command29_Click() '五
Dim ulBook As Excel.Workbook
Dim ulSheet As Excel.Worksheet
Set ulBook = xlApp.Workbooks.Add '新建一个存储结果
Set ulSheet = ulBook.Worksheets(1)
ulSheet.Activate
ulSheet.Range("A1:K" & m).Select
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
End With
ulSheet.Columns("A:C").Select
Selection.ColumnWidth = 8
pb2 = "D:\GuoResult\53OilArea.xls"
ulBook.SaveAs FileName:=pb2
ulBook.Close (True)
xlApp.Quit
Set xlApp = Nothing
MsgBox ("请查看" & pb2)
End Sub
第二个按钮:
Private Sub Command28_Click() '五
Dim ulBook As Excel.Workbook
Dim ulSheet As Excel.Worksheet
Set ulBook = xlApp.Workbooks.Add '新建一个存储结果
Set ulSheet = ulBook.Worksheets(1)
ulSheet.Activate
ulSheet.Range("A1:K" & m).Select
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
End With
ulSheet.Columns("A:C").Select
Selection.ColumnWidth = 8
pb2 = "D:\GuoResult\53OilArea.xls"
ulBook.SaveAs FileName:=pb2
ulBook.Close (True)
xlApp.Quit
Set xlApp = Nothing
MsgBox ("请查看" & pb2)
End Sub