Vba把Excel某个范围保存为XLS工作薄文件
Vba把Excel某个范围保存为XLS工作薄文件
发布时间:2015-06-06 来源:查字典编辑
摘要:Dimwn$,shpAsShape,arrApplication.ScreenUpdating=FalseApplication.Displ...

Dim wn$, shp As Shape, arr

Application.ScreenUpdating = False

Application.DisplayAlerts = False

wn = [a1]

arr = Range("o3:o" & Range("o65536").End(xlUp).Row)

Sheets("报表").Copy

With ActiveWorkbook

With .Sheets(1)

.Rows("1:2").Delete Shift:=xlUp

.Range("D:D,P:P").NumberFormatLocal = "@"

.[o1].Resize(UBound(arr)) = arr

With .UsedRange

.Value = .Value

End With

For Each shp In .Shapes

shp.Delete

Next

End With

.SaveAs ThisWorkbook.Path & "" & wn & ".xls", IIf(Application.Version <= 11, xlNormal, xlExcel8)

.Close

End With

Application.DisplayAlerts = True

Application.ScreenUpdating = True

MsgBox "ok"

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新Excel教程学习
热门Excel教程学习
电脑子分类