|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub 消除()
Dim i&, n&, m&
Dim sh As Worksheet
Application.DisplayAlerts = False
n = ThisWorkbook.Sheets.Count
For m = 2 To n
Set sh = Sheets(m)
For i = 1 To [A65536].End(3).Row
If sh.Cells(i, 8) = "" Then
sh.Range(sh.Cells(i, 1), sh.Cells(i, 7)) = Clear
If sh.Cells(i, 10) = "" Then
sh.Range(sh.Cells(i, 11), sh.Cells(i, 17)) = Clear
If sh.Cells(i, 26) = "" Then
sh.Range(sh.Cells(i, 19), sh.Cells(i, 25)) = Clear
If sh.Cells(i, 28) = "" Then
sh.Range(sh.Cells(i, 29), sh.Cells(i, 35)) = Clear
End If
End If
End If
End If
Next
Next
End Sub
|
|