使用宏对excel表格进行颜色填充
前期准备工作(包括相关工具或所使用的原料等)
MicroSoft Excel
详细的操作方法或具体步骤
把一行中连续出现三次以上的的表格进行填充为黄色,如下图的L3,L11,M11。

进入宏编辑器,将以下代码复制进去,然后执行。
Sub FillRed() Dim i As Integer Dim j As Integer For i=2 To 1200 '控制行范围 For j=10 To 100 '控制列范围 If ActiveSheet.Cells(i, j).Value <> "" Then If ActiveSheet.Cells(i, j + 1).Value <> "" Then If ActiveSheet.Cells(i, j + 2).Value <> "" Then ActiveSheet.Cells(i, j + 2).Interior.ColorIndex=3 End If End If End If Next j Next iEnd Sub

效果如下图所示

- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
