体验零代码搭建

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

网友投稿  ·  2023-12-18 17:12  ·  行业资讯  ·  阅读 348


  Dim wn$, shp As Shape, arr

  Dim wn$, shp As Shape, arr

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

  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"


是不是全部都变成负数了?这招使用的方法 << 上一篇
2023-12-18 17:12
步骤是:选定区域A10:C12(先选A10)
2023-12-18 18:12
下一篇 >>

相关推荐