Dzwebs.Net

撰写电脑技术杂文十余年

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

Admin | 2015-2-1 7:40:36 | 被阅次数 | 4856

温馨提示!

如果未能解决您的问题,请点击搜索;登陆可复制文章,点击登陆
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杂文

上一篇:ceiling语法及例子

下一篇:VBA把记事本保存成为工作薄

网站备案号:

网站备案号:滇ICP备11001339号-7

版权属性:

Copyright 2007-2021-forever Inc. all Rights Reserved.

联系方式:

Email:dzwebs@126.com QQ:83539231 访问统计