八亿网

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

时间:2015-03-13 来源:网络 作者:win8e 阅读:108

  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 = http://www.3lian.com/edu/2015/03-02/.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教程 · 相关内容