[英]How do I colour a row in Excel using vba?
I have a large excel sheet that has a few cells coloured green within a column.我有一个大的 excel 表,其中有一列中有几个绿色的单元格。 How can I identify the green cell and subsequently turn the entire row into the same background colour?
如何识别绿色单元格并随后将整行变成相同的背景颜色?
For i = 2 To LastRow
If Worksheets("Request Results").Cells(i, 4).Value <> Worksheets("Request Results").Cells(i, 6).Value Then
Cells(i, 1).EnitreRow.Interior.ColorIndex = 255
ElseIf Worksheets("Request Results").Cells(i, 4).Value = Worksheets("Request Results").Cells(i, 6).Value Then
Cells(i, 1).EntireRow.Interior.ColorIndex = 5296274
End If
Next i
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.