这是我从运行宏中获得的一个简单代码,但它需要很长时间才能处理。任何擅长vba的人都可以解决这个问题吗? 感谢。
Sub ClearAll()
Application.ScreenUpdating = False
Range("H2:H11").Select
Selection.ClearContents
Range("A2:A100").Select
Selection.ClearContents
Selection.ClearFormats
Sheets(2).Select
Cells.Select
Selection.ClearContents
ThisWorkbook.Sheets(3).Rows("2:" & Rows.Count).Delete
Sheets(1).Select
Range("A2").Select
ActiveSheet.UsedRange
ThisWorkbook.Save
Application.ScreenUpdating = True
End Sub
答案 0 :(得分:0)
好一点......
Sub ClearAll()
Application.ScreenUpdating = False
Range("H2:H11").ClearContents
With Range("A2:A100")
.ClearContents
.ClearFormats
End With
Sheets(2).Cells.ClearContents
Sheets(3).Rows("2:" & Rows.Count).Delete
Sheets(1).UsedRange.Select
ThisWorkbook.Save
Application.ScreenUpdating = True
End Sub