
1个回答
展开全部
Sub 宏1()
'
' 宏1 宏
Cells.Select
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Dim s, e
i = 2
Do While Sheet1.Cells(i, 2) <> "" Or Sheet1.Cells(i + 1, 2) <> "" Or Sheet1.Cells(i + 2, 2) <> ""
Sheet1.Cells(i, 14) = i
If Sheet1.Cells(i, 3) = "户主" Then
s = i
End If
If Sheet1.Cells(i, 9) <> "" And Sheet1.Cells(i, 9) <> Sheet1.Cells(s, 9) Then
t = i & ":" & i
Rows(t).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
i = i + 1
Loop
'
End Sub
'
' 宏1 宏
Cells.Select
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Dim s, e
i = 2
Do While Sheet1.Cells(i, 2) <> "" Or Sheet1.Cells(i + 1, 2) <> "" Or Sheet1.Cells(i + 2, 2) <> ""
Sheet1.Cells(i, 14) = i
If Sheet1.Cells(i, 3) = "户主" Then
s = i
End If
If Sheet1.Cells(i, 9) <> "" And Sheet1.Cells(i, 9) <> Sheet1.Cells(s, 9) Then
t = i & ":" & i
Rows(t).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End If
i = i + 1
Loop
'
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询