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

2024-04-21 122 0

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"

相关文章

Switch怎样限制孩子下载的游戏类型
如何批量修改Word文档正文字体格式
win10设置新密码总是不符合
如何解决win10系统开机速度慢问题
win10休眠在哪里
win10如何更**辨率?