数据及结果如图

代码如下:
Sub my_color()
Dim arr, temp(), r&, i&, j&, n&
r = Cells(Rows.Count, 1).End(xlUp).Row
arr = Range("a1:b" & r)
For i = 1 To UBound(arr)
If arr(i, 2) = 1 Then
n = n + 1
ReDim Preserve temp(1 To n)
temp(n) = arr(i, 1)
End If
Next
For j = 1 To n
For i = 1 To UBound(arr)
If arr(i, 1) = temp(j) Then
Cells(i, 1).Font.Color = 255
If arr(i, 2) = 1 Then
Cells(i, 2).Font.Color = 255
End If
End If
Next
Next
End Sub
百度最近真的不删帖么?

代码如下:
Sub my_color()
Dim arr, temp(), r&, i&, j&, n&
r = Cells(Rows.Count, 1).End(xlUp).Row
arr = Range("a1:b" & r)
For i = 1 To UBound(arr)
If arr(i, 2) = 1 Then
n = n + 1
ReDim Preserve temp(1 To n)
temp(n) = arr(i, 1)
End If
Next
For j = 1 To n
For i = 1 To UBound(arr)
If arr(i, 1) = temp(j) Then
Cells(i, 1).Font.Color = 255
If arr(i, 2) = 1 Then
Cells(i, 2).Font.Color = 255
End If
End If
Next
Next
End Sub
百度最近真的不删帖么?


