|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
代码好久,但感觉运行的好慢,如何优化
- Sub 清空值()
- Dim sh As Worksheet
- Set sh = Worksheets("sheet3")
- Dim n As Integer
- n = 24
- Do
- If sh.Cells(n, 10) = "" Then
- sh.Cells(n, 3) = ""
- sh.Cells(n, 7) = ""
- sh.Cells(n, 8) = ""
- sh.Cells(n, 11) = ""
- sh.Cells(n, 12) = ""
- sh.Cells(n, 13) = ""
- sh.Cells(n, 14) = ""
- sh.Cells(n, 15) = ""
- sh.Cells(n, 16) = ""
- sh.Cells(n, 17) = ""
- sh.Cells(n, 18) = ""
- sh.Cells(n, 21) = ""
- End If
- n = n - 1
- Loop Until sh.Cells(n, 10) <> ""
- End Sub
复制代码
|
|