当前位置: 首页 » 产品 » 新闻资讯 » 正文

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

放大字体  缩小字体 发布日期: 2024-09-24 22:28   来源:http://www.baidu.com/  作者:无忧资讯  浏览次数:10
核心提示:  Dim wn$, shp As Shape, arr  Application.ScreenUpdating=False  Application.DisplayAlerts=False  wn=[a1]  arr=

  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"

 
 
[ 产品搜索 ]  [ 加入收藏 ]  [ 告诉好友 ]  [ 打印本文 ]  [ 违规举报 ]  [ 关闭窗口 ]

 

 
推荐图文
推荐产品
点击排行
    行业协会  备案信息  可信网站