- Sub xx()
- Dim x%, z%, y%
- With Sheet1
- x = .Cells(17, .Columns.Count).End(1).Column
- .[C2:C10].ClearContents
- For i = 17 To 24
- If .Cells(i, x).Interior.Color = 49407 Then
- z = .Cells(i, x)
- y = i - 15
- Exit For
- End If
- Next
- For i = 1 To 9
- .Cells(i, 2) = .Cells(i + 15, x)
- If .Cells(i, 2) = 0 Or .Cells(i, 2) > z Then
- .Cells(i, 2).Font.Color = 255
- Else
- .Cells(i, 2).Font.Color = 0
- End If
- If z = 0 Then .Cells(i, 2).Font.Color = 0
- If .Cells(i, 2) = z Then
- .Cells(i, 2).Font.Color = 11312130
- .Cells(i, 2).Offset(0, 1).Font.Color = 255
- End If
- If .Cells(i, 2) = 1 And i <> y Then .Cells(i, 2).Font.Color = 0
- If .Cells(i, 2) = 2 And i <> y Then .Cells(i, 2).Font.Color = 0
- Next
- .Cells(y, 3) = "色位"
- .Cells(y, 3).Offset(0, 1).Font.Color = 255
- .[C10] = z
- End With
- End Sub
复制代码 |