Vba把Excel某个范围保存为XLS工作薄文件

 
Vba把Excel某个范围保存为XLS工作薄文件
2016-09-16 05:08:23 /故事大全

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"

所属专题:
如果您觉得本文或图片不错,请把它分享给您的朋友吧!

 
故事大全
 
版权所有- © 2012-2015 · 故事大全 SITEMAP站点地图手机看故事 站点地图