简体   繁体   English

如何使用 vba 在 Excel 中为一行着色?

[英]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.

相关问题 如何使用vba在Excel 2007中找到有条件格式化单元格的填充颜色值? - How do I find the fill colour value of a conditionally formatted cell in Excel 2007 using vba? 如何删除 Excel 表中的一行,该表位于使用 VBA 的用户窗体搜索字段找到的另一张表上? - How do I delete a row in an Excel Table that is on another Sheet that was found with a Userform search field using VBA? Excel —在VBA中,如何使用每行1个值找到矩阵中所有可能的值之和? - Excel — In VBA, how do I find all possible sums of values in a matrix using 1 value per row? 使用Excel VBA,如何基于该行中的其他条件计算总和? - Using Excel VBA, how do I calculate a sum based on other conditions in that row? 如何在Excel VBA中连续查找具有连续数据的单元格? - How Do I Find The Cells With Contiguous Data In A Row In Excel VBA? 如何删除VBA / Excel中第X行下面的所有内容? - How do I delete everything below row X in VBA/Excel? 如何使用VBA冻结excel中的活动行? - How do I freeze the active row in excel with VBA? Excel + VBA如何使用自己的内容设置单元格的bg颜色? - Excel+VBA How can I set the bg colour of a cell using its own contents? 如何使用VBA将带有按钮的行添加到excel表中? - How can I add a row with buttons to an excel table using VBA? 如何使用 VBA 在所选位置在 Excel 中插入一行? - How can I insert a row in Excel, at the selected location using VBA?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM