|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
这就是几个判断吧
Private Sub Test()
Dim i, j, k, arr, brr, x, y
Dim sht As Worksheet
For Each sht In Sheets
With sht
For i = 1 To .Cells(Rows.Count, 1).End(xlUp).Row
If .Cells(i, 1) <> "" And .Cells(i, 1) <> "序号" Then
If .Cells(i, 1).Offset(0, 1) = "" Then
.Range(.Cells(i, 2), .Cells(i, "k")).Interior.Color = vbBlue
ElseIf .Cells(i, 1).Offset(0, 1) <> .Cells(i, 1).Offset(0, 2) Then
.Range(.Cells(i, 2), .Cells(i, "k")).Interior.Color = vbBlue
End If
End If
Next
End With
Next
End Sub
|
|