'該vba檢查區(qū)域內(nèi)空白
Sub checkspace()
k = Range("L1").Value
If k > 1 Then
For i = 2 To k
'第二行到第k行,修改為自己的需要的行限制,k值在L1修改
For j = 2 To 3
'第2列到第三列,修改為自己的需要的列限制
Cells(i, j).Select
If Cells(i, j) = "" Then
Cells(i, j).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Else
With Selection.Interior
.Pattern = xlNone
'.TintAndShade = O
.PatternTintAndShade = 0
End With
End If
Next
Next
End If
End Sub